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: <4df7c198.210b.1764d38a318.Coremail.shaojie.dong@isrc.iscas.ac.cn>
Date:   Thu, 10 Dec 2020 23:15:26 +0800 (GMT+08:00)
From:   shaojie.dong@...c.iscas.ac.cn
To:     "Greg KH" <gregkh@...uxfoundation.org>
Cc:     Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: Re: [PATCH] staging: rtl8712: check register_netdev() return
 value

Hi

Thanks !  I will modify sign name correctly later

Sorry to say that I have no rtl8712 hardware, so that I could not test it.

From Dan Carpenter's email reply, "free_netdev(adapter-&gt;pnetdev)" function may cause use after free issue
So that I reply email to ensure if this return value should be check or how to handle this return value error


&gt; -----原始邮件-----
&gt; 发件人: "Greg KH" <gregkh@...uxfoundation.org>
&gt; 发送时间: 2020-12-09 23:13:40 (星期三)
&gt; 收件人: shaojie.dong@...c.iscas.ac.cn
&gt; 抄送: Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com, devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
&gt; 主题: Re: [PATCH] staging: rtl8712: check register_netdev() return value
&gt; 
&gt; On Wed, Dec 09, 2020 at 11:01:24PM +0800, shaojie.dong@...c.iscas.ac.cn wrote:
&gt; &gt; From: "shaojie.dong" <shaojie.dong@...c.iscas.ac.cn>
&gt; &gt; 
&gt; &gt; Function register_netdev() can fail, so we should check it's return value
&gt; &gt; 
&gt; &gt; Signed-off-by: shaojie.dong <shaojie.dong@...c.iscas.ac.cn>
&gt; 
&gt; I doubt you sign your name with a '.' in it, right?
&gt; 
&gt; Please resend with the correct name, and using Capital letters where
&gt; needed.
&gt; 
&gt; &gt; ---
&gt; &gt;  drivers/staging/rtl8712/hal_init.c | 5 ++++-
&gt; &gt;  1 file changed, 4 insertions(+), 1 deletion(-)
&gt; &gt; 
&gt; &gt; diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c
&gt; &gt; index 715f1fe8b..38a3e3d44 100644
&gt; &gt; --- a/drivers/staging/rtl8712/hal_init.c
&gt; &gt; +++ b/drivers/staging/rtl8712/hal_init.c
&gt; &gt; @@ -45,7 +45,10 @@ static void rtl871x_load_fw_cb(const struct firmware *firmware, void *context)
&gt; &gt;  	}
&gt; &gt;  	adapter-&gt;fw = firmware;
&gt; &gt;  	/* firmware available - start netdev */
&gt; &gt; -	register_netdev(adapter-&gt;pnetdev);
&gt; &gt; +	if (register_netdev(adapter-&gt;pnetdev) != 0) {
&gt; &gt; +		netdev_err(adapter-&gt;pnetdev, "register_netdev() failed\n");
&gt; &gt; +		free_netdev(adapter-&gt;pnetdev);
&gt; &gt; +	}
&gt; 
&gt; Did you test this to see if this really properly cleans everything up?
&gt; 
&gt; And your if statement can be simplified, please do so.
&gt; 
&gt; thanks,
&gt; 
&gt; greg k-h
</shaojie.dong@...c.iscas.ac.cn></shaojie.dong@...c.iscas.ac.cn></gregkh@...uxfoundation.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ