]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()
authorBrooke Basile <brookebasile@gmail.com>
Fri, 11 Sep 2020 07:14:27 +0000 (03:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Oct 2020 09:38:30 +0000 (10:38 +0100)
commitdf4318440c1568b7dedc5f7d4e617d0e297a1313
tree248d19b1651e118f65bd649ec1e2a283cb1c8b29
parent03e738d32d460089f4f22512bc2166d5c2943862
ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()

[ Upstream commit 03fb92a432ea5abe5909bca1455b7e44a9380480 ]

Calls to usb_kill_anchored_urbs() after usb_kill_urb() on multiprocessor
systems create a race condition in which usb_kill_anchored_urbs() deallocates
the URB before the completer callback is called in usb_kill_urb(), resulting
in a use-after-free.
To fix this, add proper lock protection to usb_kill_urb() calls that can
possibly run concurrently with usb_kill_anchored_urbs().

Reported-by: syzbot+89bd486af9427a9fc605@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=cabffad18eb74197f84871802fd2c5117b61febf
Signed-off-by: Brooke Basile <brookebasile@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200911071427.32354-1-brookebasile@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath9k/hif_usb.c