diff mbox series

rtlwifi: Fix non-canonical address access issues

Message ID 1603768580-2798-1-git-send-email-WeitaoWang-oc@zhaoxin.com
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series rtlwifi: Fix non-canonical address access issues | expand

Checks

Context Check Description
jkicinski/header_inline success Link
jkicinski/cover_letter success Link
jkicinski/fixes_present success Link
jkicinski/patch_count success Link
jkicinski/tree_selection success Guessed tree name to be net-next
jkicinski/subject_prefix success Link
jkicinski/source_inline success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/module_param success Was 0 now: 0
jkicinski/build_32bit fail Errors and warnings before: 4 this patch: 4
jkicinski/kdoc success Errors and warnings before: 0 this patch: 0
jkicinski/verify_fixes success Link
jkicinski/checkpatch fail Link
jkicinski/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
jkicinski/stable success Stable not CCed

Commit Message

WeitaoWangoc Oct. 27, 2020, 3:16 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. So, 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, 3:28 a.m. UTC | #1
On Tue, 2020-10-27 at 11:16 +0800, WeitaoWangoc wrote:
> 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. So, 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>

Thanks for your patch.

Acked-by: Ping-Ke Shih <pkshih@realtek.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;
>  }
>
Kalle Valo Nov. 7, 2020, 3:50 p.m. UTC | #2
WeitaoWangoc <WeitaoWang-oc@zhaoxin.com> wrote:

> 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. So, 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>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-drivers-next.git, thanks.

c521d7e0ff05 rtlwifi: Fix non-canonical address access issues
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;
 }