public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Skripkin <paskripkin@gmail.com>
To: Wang Cheng <wanngchenng@gmail.com>, dan.carpenter@oracle.com
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] staging: rtl8712: fix uninit-value in r871xu_drv_init()
Date: Fri, 6 May 2022 15:35:05 +0300	[thread overview]
Message-ID: <972ec318-680d-e13c-4aac-07c2c039706c@gmail.com> (raw)
In-Reply-To: <9f0bf5e0-87e8-ce27-7c2d-8e247e7b5f4f@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1884 bytes --]

Hi Pavel,

On 5/6/22 15:27, Pavel Skripkin wrote:
> Hi Wang,
> 
> On 5/6/22 14:59, Wang Cheng wrote:
>> Reported-and-tested-by: syzbot+6f5ecd144854c0d8580b@syzkaller.appspotmail.com
>> Signed-off-by: Wang Cheng <wanngchenng@gmail.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))) {
>>   			mac[0] = 0x00;
>>   			mac[1] = 0xe0;
>>   			mac[2] = 0x4c;
> 
> Hmm,
> 
> the whole r871xu_drv_init() looks odd, but it's unrelated.
> 
> I see that this patch does not help with below kernel path
> 
> r871xu_drv_init()
>     if (tmpU1b & _EEPROM_EN) <- true [1]
> 	if (!r8712_initmac || !mac_pton(r8712_initmac, mac)) <- (*)
> 		if ((!AutoloadFail) ||	<- false, since [1] branch taken
> 			[code touches stack data]
> 
> (*) false because of r8712_initmac is equal to NULL
> 

Oops, I am blind, ignore that one, please. The whole idea is wrong.

I need to go to sleep earlier today

sorry about that,


With regards,
Pavel Skripkin

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-05-06 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 11:59 [PATCH v3 0/3] staging: rtl8712: fix KMSAN: uninit-value in r871xu_drv_init Wang Cheng
2022-05-06 11:59 ` [PATCH v3 1/3] staging: rtl8712: fix uninit-value in usb_read8() and friends Wang Cheng
2022-05-06 12:12   ` Pavel Skripkin
2022-05-10  3:34     ` Wang Cheng
2022-05-06 11:59 ` [PATCH v3 2/3] staging: rtl8712: fix uninit-value in r871xu_drv_init() Wang Cheng
2022-05-06 12:27   ` Pavel Skripkin
2022-05-06 12:35     ` Pavel Skripkin [this message]
2022-05-06 12:01 ` [PATCH v3 3/3] staging: rtl8712: add error handler in r8712_usbctrl_vendorreq() Wang Cheng
2022-05-06 12:13   ` Pavel Skripkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=972ec318-680d-e13c-4aac-07c2c039706c@gmail.com \
    --to=paskripkin@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=wanngchenng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox