CVE-2023-54213: USB: sisusbvga: Add endpoint checks
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
USB: sisusbvga: Add endpoint checks
The syzbot fuzzer was able to provoke a WARNING from the sisusbvga driver:
------------[ cut here ]------------ usb 1-1: BOGUS urb xfer, pipe 3 != type 1 WARNING: CPU: 1 PID: 26 at drivers/usb/core/urb.c:504 usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504 Modules linked in: CPU: 1 PID: 26 Comm: kworker/1:1 Not tainted 6.2.0-rc5-syzkaller-00199-g5af6ce704936 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Workqueue: usb_hub_wq hub_event RIP: 0010:usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504 Code: 7c 24 18 e8 6c 50 80 fb 48 8b 7c 24 18 e8 62 1a 01 ff 41 89 d8 44 89 e1 4c 89 ea 48 89 c6 48 c7 c7 60 b1 fa 8a e8 84 b0 be 03 <0f> 0b e9 58 f8 ff ff e8 3e 50 80 fb 48 81 c5 c0 05 00 00 e9 84 f7 RSP: 0018:ffffc90000a1ed18 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 RDX: ffff888012783a80 RSI: ffffffff816680ec RDI: fffff52000143d95 RBP: ffff888079020000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000080000000 R11: 0000000000000000 R12: 0000000000000003 R13: ffff888017d33370 R14: 0000000000000003 R15: ffff888021213600 FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005592753a60b0 CR3: 0000000022899000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> sisusb_bulkout_msg drivers/usb/misc/sisusbvga/sisusbvga.c:224 [inline] sisusb_send_bulk_msg.constprop.0+0x904/0x1230 drivers/usb/misc/sisusbvga/sisusbvga.c:379 sisusb_send_bridge_packet drivers/usb/misc/sisusbvga/sisusbvga.c:567 [inline] sisusb_do_init_gfxdevice drivers/usb/misc/sisusbvga/sisusbvga.c:2077 [inline] sisusb_init_gfxdevice+0x87b/0x4000 drivers/usb/misc/sisusbvga/sisusbvga.c:2177 sisusb_probe+0x9cd/0xbe2 drivers/usb/misc/sisusbvga/sisusbvga.c:2869
...
The problem was caused by the fact that the driver does not check whether the endpoints it uses are actually present and have the appropriate types. This can be fixed by adding a simple check of the endpoints.
The Linux kernel CVE team has assigned CVE-2023-54213 to this issue.
Affected and fixed versions
===========================
Fixed in 4.14.316 with commit bccb2ccb65515dc66a8001f99f4dcba8a45987f9 Fixed in 4.19.284 with commit a8f980ecb0112100366c64e0404d9dd1dcbd2fcd Fixed in 5.4.244 with commit a730feb672c7d7c5f7414c3715f8e3fa844e5a9b Fixed in 5.10.181 with commit ccef03c5113506d27dd6530d3a9ef5715c068e13 Fixed in 5.15.114 with commit 43f569fd0699c4240a5c96e5ba1a0844a595afca Fixed in 6.1.31 with commit d5dba4b7bf904143702fb4be641802ee2e9c95aa Fixed in 6.3.5 with commit 0f9028b6ffaa98bff7c479cccf2558247e295534 Fixed in 6.4 with commit df05a9b05e466a46725564528b277d0c570d0104
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2023-54213
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/usb/misc/sisusbvga/sisusbvga.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/bccb2ccb65515dc66a8001f99f4dcba8a45987f9 https://git.kernel.org/stable/c/a8f980ecb0112100366c64e0404d9dd1dcbd2fcd https://git.kernel.org/stable/c/a730feb672c7d7c5f7414c3715f8e3fa844e5a9b https://git.kernel.org/stable/c/ccef03c5113506d27dd6530d3a9ef5715c068e13 https://git.kernel.org/stable/c/43f569fd0699c4240a5c96e5ba1a0844a595afca https://git.kernel.org/stable/c/d5dba4b7bf904143702fb4be641802ee2e9c95aa https://git.kernel.org/stable/c/0f9028b6ffaa98bff7c479cccf2558247e295534 https://git.kernel.org/stable/c/df05a9b05e466a46725564528b277d0c570d0104