Commit 647d6b8
ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
commit 9f2c0ac upstream.
The previous commit 0718a78 ("ALSA: usb-audio: Kill timer properly at
removal") patched a UAF issue caused by the error timer.
However, because the error timer kill added in this patch occurs after the
endpoint delete, a race condition to UAF still occurs, albeit rarely.
Additionally, since kill-cleanup for urb is also missing, freed memory can
be accessed in interrupt context related to urb, which can cause UAF.
Therefore, to prevent this, error timer and urb must be killed before
freeing the heap memory.
Cc: <stable@vger.kernel.org>
Reported-by: syzbot+f02665daa2abeef4a947@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f02665daa2abeef4a947
Fixes: 0718a78 ("ALSA: usb-audio: Kill timer properly at removal")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent c611b9e commit 647d6b8
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1525 | 1528 | | |
1526 | 1529 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
| 1530 | + | |
1531 | 1531 | | |
1532 | 1532 | | |
1533 | | - | |
1534 | 1533 | | |
1535 | 1534 | | |
1536 | 1535 | | |
| |||
0 commit comments