In the Linux kernel, the following vulnerability has been resolved:
usb-storage: alauda: Fix uninit-value in alaudacheckmedia()
Syzbot got KMSAN to complain about access to an uninitialized value in the alauda subdriver of usb-storage:
BUG: KMSAN: uninit-value in alaudatransport+0x462/0x57f0 drivers/usb/storage/alauda.c:1137 CPU: 0 PID: 12279 Comm: usb-storage Not tainted 5.3.0-rc7+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: _dumpstack lib/dumpstack.c:77 [inline] dumpstack+0x191/0x1f0 lib/dumpstack.c:113 kmsanreport+0x13a/0x2b0 mm/kmsan/kmsanreport.c:108 _msanwarning+0x73/0xe0 mm/kmsan/kmsaninstr.c:250 alaudacheck_media+0x344/0x3310 drivers/usb/storage/alauda.c:460
The problem is that alaudacheckmedia() doesn't verify that its USB transfer succeeded before trying to use the received data. What should happen if the transfer fails isn't entirely clear, but a reasonably conservative approach is to pretend that no media is present.
A similar problem exists in a usbstordbg() call in alaudagetmediastatus(). In this case, when an error occurs the call is redundant, because usbstorctrltransfer() already will print a debugging message.
Finally, unrelated to the uninitialized memory access, is the fact that alaudacheckmedia() performs DMA to a buffer on the stack. Fortunately usb-storage provides a general purpose DMA-able buffer for uses like this. We'll use it instead.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53847.json"
}