diff mbox series

Net/Usb:Fix realtek wireless NIC non-canonical address access issues

Message ID 1603193939-3458-1-git-send-email-WeitaoWang-oc@zhaoxin.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series Net/Usb:Fix realtek wireless NIC non-canonical address access issues | expand

Commit Message

Weitao Wang Oct. 20, 2020, 11:38 a.m. UTC
During realtek USB wireless NIC initialization, it's unexpected
disconnection will cause urb sumbmit fail.On the one hand,
_rtl_usb_cleanup_rx will be called to clean up rx stuff, especially
for rtl_wq. On the other hand, disconnection will cause rtl_usb_disconnect
and _rtl_usb_cleanup_rx to be called.Finnally,rtl_wq will be flush/destroy
twice,which will cause non-canonical address 0xdead000000000122 access and
general protection fault.

Fixed this issue by remove _rtl_usb_cleanup_rx when urb sumbmit fail.

Signed-off-by: WeitaoWangoc <WeitaoWang-oc@zhaoxin.com>
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Ping-Ke Shih Oct. 27, 2020, 1:48 a.m. UTC | #1
On Tue, 2020-10-20 at 19:38 +0800, WeitaoWangoc wrote:

For rtlwifi driver, please use 'rtlwifi: ' as prefix of mail subject, like
"rtlwifi: Fix non-canonical address access issues"

> During realtek USB wireless NIC initialization, it's unexpected
> disconnection will cause urb sumbmit fail.On the one hand,

nit: add space right after period, like "... fail. On the one hand ..."

> _rtl_usb_cleanup_rx will be called to clean up rx stuff, especially
> for rtl_wq. On the other hand, disconnection will cause rtl_usb_disconnect
> and _rtl_usb_cleanup_rx to be called.Finnally,rtl_wq will be flush/destroy
> twice,which will cause non-canonical address 0xdead000000000122 access and
> general protection fault.
> 
> Fixed this issue by remove _rtl_usb_cleanup_rx when urb sumbmit fail.
> 
> Signed-off-by: WeitaoWangoc <WeitaoWang-oc@zhaoxin.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/usb.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c
> b/drivers/net/wireless/realtek/rtlwifi/usb.c
> index 06e073d..d62b87f 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/usb.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
> @@ -731,7 +731,6 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
>  
>  err_out:
>  	usb_kill_anchored_urbs(&rtlusb->rx_submitted);
> -	_rtl_usb_cleanup_rx(hw);
>  	return err;
>  }
>
Weitao Wang Oct. 27, 2020, 2:23 a.m. UTC | #2
On  Tue, 2020-10-27 at 09:39 +0800, Pkshih Wrote:
>On Tue, 2020-10-20 at 19:38 +0800, WeitaoWangoc wrote:

>For rtlwifi driver, please use 'rtlwifi: ' as prefix of mail subject, like
>"rtlwifi: Fix non-canonical address access issues"

>> During realtek USB wireless NIC initialization, it's unexpected
>> disconnection will cause urb sumbmit fail.On the one hand,

>nit: add space right after period, like "... fail. On the one hand ..."

Thanks for Your suggestion, I will resend this mail. 

Weitaowang
Thanks
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 06e073d..d62b87f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -731,7 +731,6 @@  static int _rtl_usb_receive(struct ieee80211_hw *hw)
 
 err_out:
 	usb_kill_anchored_urbs(&rtlusb->rx_submitted);
-	_rtl_usb_cleanup_rx(hw);
 	return err;
 }