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]
Date:   Fri, 6 May 2022 15:02:05 +0300
From:   Pavel Skripkin <paskripkin@...il.com>
To:     Wang Cheng <wanngchenng@...il.com>
Cc:     dan.carpenter@...cle.com, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] staging: rtl8712: fix uninit-value in
 r871xu_drv_init()

Hi Wang,

On 5/6/22 14:33, Wang Cheng wrote:
> On 22/05/06 10:41AM, Pavel Skripkin wrote:
>> Hi Wang,
>> 
>> On 5/6/22 06:16, Wang Cheng wrote:
>> 
>> [snip]
>> 
>> > 
>> > Reported-and-tested-by: syzbot+6f5ecd144854c0d8580b@...kaller.appspotmail.com
>> > Signed-off-by: Wang Cheng <wanngchenng@...il.com>
>> > ---
>> >   drivers/staging/rtl8712/usb_intf.c | 6 +++---
>> >   1 file changed, 3 insertions(+), 3 deletions(-)
>> > 
>> > diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
>> > index ee4c61f85a07..50dcd3ecb685 100644
>> > --- a/drivers/staging/rtl8712/usb_intf.c
>> > +++ b/drivers/staging/rtl8712/usb_intf.c
>> > @@ -538,13 +538,13 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
>> >   		} else {
>> >   			AutoloadFail = false;
>> >   		}
>> > -		if (((mac[0] == 0xff) && (mac[1] == 0xff) &&
>> > +		if ((!AutoloadFail) ||
>> > +		    ((mac[0] == 0xff) && (mac[1] == 0xff) &&
>> >   		     (mac[2] == 0xff) && (mac[3] == 0xff) &&
>> >   		     (mac[4] == 0xff) && (mac[5] == 0xff)) ||
>> >   		    ((mac[0] == 0x00) && (mac[1] == 0x00) &&
>> >   		     (mac[2] == 0x00) && (mac[3] == 0x00) &&
>> > -		     (mac[4] == 0x00) && (mac[5] == 0x00)) ||
>> > -		     (!AutoloadFail)) {
>> > +		     (mac[4] == 0x00) && (mac[5] == 0x00))) {
>> 
>> 
>> That looks ugly. I mean mac checks. Can we, please, use sane kernel API like
>> is_valid_ether_addr()?
> 
> Good idea! But will is_valid_ether_addr() check a larger range?
> The comment of is_valid_ether_addr()(include/linux/etherdevice.h) says:
>    Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
>    a *multicast address*, and is not FF:FF:FF:FF:FF:FF.
> 

I am not good an expert at networking stuff, but can multicast mac 
address be valid for purpose of Wi-Fi adapter? IIUC it's can't, but as I 
said before, I am not an expert



With regards,
Pavel Skripkin

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ