OSDN Git Service

rtlwifi: Fix non-canonical address access issues
authorWeitaoWangoc <WeitaoWang-oc@zhaoxin.com>
Tue, 27 Oct 2020 03:16:20 +0000 (11:16 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 7 Nov 2020 15:49:57 +0000 (17:49 +0200)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1603768580-2798-1-git-send-email-WeitaoWang-oc@zhaoxin.com
drivers/net/wireless/realtek/rtlwifi/usb.c

index 06e073d..d62b87f 100644 (file)
@@ -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;
 }