ALSA: usb-audio: Fix out of bounds reads when finding clock sources
commit a3dd4d63 upstream. The current USB-audio driver code doesn't check bLength of each descriptor at traversing for clock descriptors. That is, when a device provides a bogus descriptor with a shorter bLength, the driver might hit out-of-bounds reads. For addressing it, this patch adds sanity checks to the validator functions for the clock descriptor traversal. When the descriptor length is shorter than expected, it's skipped in the loop. For the clock source and clock multiplier descriptors, we can just check bLength against the sizeof() of each descriptor type. OTOH, the clock selector descriptor of UAC2 and UAC3 has an array of bNrInPins elements and two more fields at its tail, hence those have to be checked in addition to the sizeof() check. Reported-by:Benoît Sevens <bsevens@google.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/20241121140613.3651-1-bsevens@google.com Link: https://patch.msgid.link/20241125144629.20757-1-tiwai@suse.de Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Benoît Sevens <bsevens@google.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
-
mentioned in commit b1dea100
-
mentioned in commit b9a97ffe
-
mentioned in commit 6fc71d5a
-
mentioned in commit 3d1fea7e
-
mentioned in commit 4f87ec8f
-
mentioned in commit d1b56944
-
mentioned in commit c1f6eb35
-
mentioned in commit 6bd3bb4d
-
mentioned in commit 78bdb24d
-
mentioned in commit 8d1040e1
-
mentioned in commit 5188a1c3
-
mentioned in commit 4976eac3
-
mentioned in commit cf582d88
-
mentioned in commit 2f200409
-
mentioned in commit 5415f35f
Please sign in to comment