Commit 2d72d5c
ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()
[ Upstream commit 03fb92a ]
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>1 parent ce4d905 commit 2d72d5c
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
| 455 | + | |
| 456 | + | |
454 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
455 | 463 | | |
| 464 | + | |
456 | 465 | | |
457 | 466 | | |
458 | 467 | | |
| |||
762 | 771 | | |
763 | 772 | | |
764 | 773 | | |
| 774 | + | |
765 | 775 | | |
766 | 776 | | |
| 777 | + | |
| 778 | + | |
767 | 779 | | |
768 | 780 | | |
769 | 781 | | |
770 | 782 | | |
771 | 783 | | |
| 784 | + | |
772 | 785 | | |
| 786 | + | |
773 | 787 | | |
774 | 788 | | |
775 | 789 | | |
776 | 790 | | |
777 | 791 | | |
| 792 | + | |
778 | 793 | | |
779 | 794 | | |
| 795 | + | |
| 796 | + | |
780 | 797 | | |
781 | 798 | | |
782 | 799 | | |
783 | 800 | | |
784 | 801 | | |
| 802 | + | |
785 | 803 | | |
| 804 | + | |
786 | 805 | | |
787 | 806 | | |
788 | 807 | | |
| |||
0 commit comments