summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2022-01-01 05:07:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-03 16:38:34 +0300
commit1d7d4c07932e04355d6e6528d44a2f2c9e354346 (patch)
treec57d517806b906fda7efaff421ade6b8a6888b94 /sound
parentfa0ef93868a6062babe1144df2807a8b1d4924d2 (diff)
downloadlinux-1d7d4c07932e04355d6e6528d44a2f2c9e354346.tar.xz
USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status
When the USB core code for getting root-hub status reports was originally written, it was assumed that the hub driver would be its only caller. But this isn't true now; user programs can use usbfs to communicate with root hubs and get status reports. When they do this, they may use a transfer_buffer that is smaller than the data returned by the HCD, which will lead to a buffer overflow error when usb_hcd_poll_rh_status() tries to store the status data. This was discovered by syzbot: BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline] BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x5f4/0x780 drivers/usb/core/hcd.c:776 Write of size 2 at addr ffff88801da403c0 by task syz-executor133/4062 This patch fixes the bug by reducing the amount of status data if it won't fit in the transfer_buffer. If some data gets discarded then the URB's completion status is set to -EOVERFLOW rather than 0, to let the user know what happened. Reported-and-tested-by: syzbot+3ae6a2b06f131ab9849f@syzkaller.appspotmail.com Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/Yc+3UIQJ2STbxNua@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
0 files changed, 0 insertions, 0 deletions