lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6c274bbd120446fb58ceb6ba9528b4b@ausx13mpc124.AMER.DELL.COM>
Date:   Mon, 22 Apr 2019 21:29:36 +0000
From:   <Mario.Limonciello@...l.com>
To:     <crag0715@...il.com>, <linux-usb@...r.kernel.org>,
        <netdev@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>, <hayeswang@...ltek.com>,
        <Crag.Wang@...l.com>, <davem@...emloft.net>, <sjg@...omium.org>,
        <grundler@...omium.org>, <seanpaul@...omium.org>,
        <David.Chen7@...l.com>, <kai.heng.feng@...onical.com>,
        <gustavo@...eddedor.com>,
        <charles.hyde@...l.corp-partner.google.com>,
        <bigeasy@...utronix.de>, <zhongjiang@...wei.com>
Subject: RE: [PATCH v2 1/1] r8152: sync sa_family with the media type of
 network device

> -----Original Message-----
> From: crag0715@...il.com <crag0715@...il.com>
> Sent: Monday, April 22, 2019 12:04 AM
> To: linux-usb@...r.kernel.org; netdev@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org; hayeswang@...ltek.com; Limonciello, Mario;
> crag0715@...il.com; Wang, Crag; David S. Miller; Simon Glass; Grant Grundler;
> Sean Paul; Chen7, David; Kai-Heng Feng; Gustavo A. R. Silva; Charles Hyde;
> Sebastian Andrzej Siewior; zhong jiang
> Subject: [PATCH v2 1/1] r8152: sync sa_family with the media type of network
> device
> 
> 
> [EXTERNAL EMAIL]
> 
> From: "Crag.Wang" <crag.wang@...l.com>
> 
> Without this patch the socket address family sporadically gets wrong
> value ends up the dev_set_mac_address() fails to set the desired MAC
> address.

Ah yes, this is because of an uninitialized struct sockaddr, so random garbage.
I didn't catch it during my testing, good catch.

> 
> Signed-off-by: Crag.Wang <crag.wang@...l.com>
> ---
>  drivers/net/usb/r8152.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 4c63b40d5e00..41fb39ce69c9 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp,
> struct sockaddr *sa)
>  	struct net_device *dev = tp->netdev;
>  	int ret;
> 
> +	sa->sa_family = dev->type;
> +
>  	if (tp->version == RTL_VER_01) {
>  		ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
>  	} else {
> --
> 2.20.1

Reviewed-By: Mario Limonciello <mario.limonciello@...l.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ