Patch "mwifiex: don't call del_timer_sync() on uninitialized timer" has been added to the 5.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mwifiex: don't call del_timer_sync() on uninitialized timer

to the 5.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mwifiex-don-t-call-del_timer_sync-on-uninitialized-t.patch
and it can be found in the queue-5.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7438859381d4aa7d77c5b6bfe5fb0f4ccfc27c17
Author: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date:   Fri Aug 21 17:27:19 2020 +0900

    mwifiex: don't call del_timer_sync() on uninitialized timer
    
    [ Upstream commit 621a3a8b1c0ecf16e1e5667ea5756a76a082b738 ]
    
    syzbot is reporting that del_timer_sync() is called from
    mwifiex_usb_cleanup_tx_aggr() from mwifiex_unregister_dev() without
    checking timer_setup() from mwifiex_usb_tx_init() was called [1].
    
    Ganapathi Bhat proposed a possibly cleaner fix, but it seems that
    that fix was forgotten [2].
    
    "grep -FrB1 'del_timer' drivers/ | grep -FA1 '.function)'" says that
    currently there are 28 locations which call del_timer[_sync]() only if
    that timer's function field was initialized (because timer_setup() sets
    that timer's function field). Therefore, let's use same approach here.
    
    [1] https://syzkaller.appspot.com/bug?id=26525f643f454dd7be0078423e3cdb0d57744959
    [2] https://lkml.kernel.org/r/CA+ASDXMHt2gq9Hy+iP_BYkWXsSreWdp3_bAfMkNcuqJ3K+-jbQ@xxxxxxxxxxxxxx
    
    Reported-by: syzbot <syzbot+dc4127f950da51639216@xxxxxxxxxxxxxxxxxxxxxxxxx>
    Cc: Ganapathi Bhat <ganapathi.bhat@xxxxxxx>
    Cc: Brian Norris <briannorris@xxxxxxxxxxxx>
    Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Brian Norris <briannorris@xxxxxxxxxxxx>
    Acked-by: Ganapathi Bhat <ganapathi.bhat@xxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200821082720.7716-1-penguin-kernel@xxxxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index 6f3cfde4654cc..426e39d4ccf0f 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -1353,7 +1353,8 @@ static void mwifiex_usb_cleanup_tx_aggr(struct mwifiex_adapter *adapter)
 				skb_dequeue(&port->tx_aggr.aggr_list)))
 				mwifiex_write_data_complete(adapter, skb_tmp,
 							    0, -1);
-		del_timer_sync(&port->tx_aggr.timer_cnxt.hold_timer);
+		if (port->tx_aggr.timer_cnxt.hold_timer.function)
+			del_timer_sync(&port->tx_aggr.timer_cnxt.hold_timer);
 		port->tx_aggr.timer_cnxt.is_hold_timer_set = false;
 		port->tx_aggr.timer_cnxt.hold_tmo_msecs = 0;
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux