ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c
If a USB sound card reports 0 interfaces, an error condition is triggered and the function usb_audio_probe errors out. In the error path, there was a use-after-free vulnerability where the memory object of the card was first freed, followed by a decrement of the number of active chips. Moving the decrement above the atomic_dec fixes the UAF. [ The original problem was introduced in 3.1 kernel, while it was developed in a different form. The Fixes tag below indicates the original commit but it doesn't mean that the patch is applicable cleanly. -- tiwai ] Fixes: 362e4e49 ("ALSA: usb-audio - clear chip->probing on error exit") Reported-by:Hui Peng <benquike@gmail.com> Reported-by:
Mathias Payer <mathias.payer@nebelwelt.net> Signed-off-by:
Hui Peng <benquike@gmail.com> Signed-off-by:
Mathias Payer <mathias.payer@nebelwelt.net> Cc: <stable@vger.kernel.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
Loading
-
mentioned in commit 1a1ded61
-
mentioned in commit f14a682d
-
mentioned in commit dab1e837
-
mentioned in commit 00fb94a7
-
mentioned in commit 9b3fe43d
-
mentioned in commit 82abce06
-
mentioned in commit 84ffb602
-
mentioned in commit e50ca59e
-
mentioned in commit f1b008ba
-
mentioned in commit c1651eea
-
mentioned in commit 07eb0321
Please sign in to comment