CVE-2021-47576·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: scsi: scsi_debug: Sanity check block descriptor length in resp_mode_select() In resp_mode_select() sanity check the block descriptor len to avoid UAF. BUG: KASAN: use-after-free in resp_mode_select+0xa4c/0xb40 drivers/scsi/scsi_debug.c:2509 Read of size 1 at addr ffff888026670f50 by task scsicmd/15032 CPU: 1 PID: 15032 Comm: scsicmd Not tainted 5.15.0-01d0625 #15 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Call Trace: <TASK> dump_stack_lvl+0x89/0xb5 lib/dump_stack.c:107 print_address_description.constprop.9+0x28/0x160 mm/kasan/report.c:257 kasan_report.cold.14+0x7d/0x117 mm/kasan/report.c:443 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 resp_mode_select+0xa4c/0xb40 drivers/scsi/scsi_debug.c:2509 schedule_resp+0x4af/0x1a10 drivers/scsi/scsi_debug.c:5483 scsi_debug_queuecommand+0x8c9/0x1e70 drivers/scsi/scsi_debug.c:7537 scsi_queue_rq+0x16b4/0x2d10 drivers/scsi/scsi_lib.c:1521 blk_mq_dispatch_rq_list+0xb9b/0x2700 block/blk-mq.c:1640 __blk_mq_sched_dispatch_requests+0x28f/0x590 block/blk-mq-sched.c:325 blk_mq_sched_dispatch_requests+0x105/0x190 block/blk-mq-sched.c:358 __blk_mq_run_hw_queue+0xe5/0x150 block/blk-mq.c:1762 __blk_mq_delay_run_hw_queue+0x4f8/0x5c0 block/blk-mq.c:1839 blk_mq_run_hw_queue+0x18d/0x350 block/blk-mq.c:1891 blk_mq_sched_insert_request+0x3db/0x4e0 block/blk-mq-sched.c:474 blk_execute_rq_nowait+0x16b/0x1c0 block/blk-exec.c:63 sg_common_write.isra.18+0xeb3/0x2000 drivers/scsi/sg.c:837 sg_new_write.isra.19+0x570/0x8c0 drivers/scsi/sg.c:775 sg_ioctl_common+0x14d6/0x2710 drivers/scsi/sg.c:941 sg_ioctl+0xa2/0x180 drivers/scsi/sg.c:1166 __x64_sys_ioctl+0x19d/0x220 fs/ioctl.c:52 do_syscall_64+0x3a/0x80 arch/x86/entry/common.c:50 entry_SYSCALL_64_after_hwframe+0x44/0xae arch/x86/entry/entry_64.S:113
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.15.11
- Published
- 2024-06-19
Affected versions
From: 5.11
Until: 5.15.11
Fixed in: 5.15.11
How to fix this CVE
Update your Linux kernel to version 5.15.11 or later to patch a use-after-free vulnerability in the SCSI debug mode select handler. This vulnerability allows local attackers with low privileges to read and write arbitrary kernel memory by sending malformed SCSI commands with invalid block descriptor lengths. Apply the kernel update through your distribution's package manager and reboot to activate the patched version.
sudo dnf update kernel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Check installed kernel version: uname -r (affected if output shows 5.11 through 5.15.10)
- Verify SCSI debug module is loaded: lsmod | grep scsi_debug (vulnerability requires this module active)
- Search system logs for SCSI mode select errors: sudo journalctl -u kernel --grep='resp_mode_select\|KASAN.*use-after-free' -a
- After patching, confirm new kernel is active: uname -r (should be 5.15.11 or later) and compare against fixed version
FAQ
What is CVE-2021-47576?
This is a use-after-free vulnerability in the Linux kernel's SCSI debug module that occurs when processing MODE SELECT SCSI commands with malformed block descriptor lengths, allowing local attackers to corrupt kernel memory.
Is CVE-2021-47576 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available, though it remains a high-severity local privilege escalation risk.
What versions of Kernel are affected by CVE-2021-47576?
Linux kernel versions 5.11 through 5.15.10 are vulnerable; version 5.15.11 and later contain the fix.
How do I check if my server is vulnerable to CVE-2021-47576?
Run 'uname -r' and check if your kernel version is between 5.11 and 5.15.10 inclusive; additionally verify 'lsmod | grep scsi_debug' to confirm the vulnerable module is loaded.
Does Defensia detect CVE-2021-47576?
Yes — Defensia's CVE advisory scanner compares installed kernel package versions against the NVD database. If Linux kernel is installed on a monitored server, CVE-2021-47576 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/04181973c38f3d6a353f9246dcf7fee08024fd9e
- https://git.kernel.org/stable/c/90491283b4064220682e4b0687d07b05df01e3bf
- https://git.kernel.org/stable/c/a9078e791426c2cbbdf28a320c3670f6e0a611e6
- https://git.kernel.org/stable/c/adcecd50da6cab7b4957cba0606771dcc846c5a9
- https://git.kernel.org/stable/c/b847ecff850719c46c95acd25a0d555dfd16e10d
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47576. Free for 1 server.
Get started free