CVE-2021-47219·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: scsi: scsi_debug: Fix out-of-bound read in resp_report_tgtpgs() The following issue was observed running syzkaller: BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:377 [inline] BUG: KASAN: slab-out-of-bounds in sg_copy_buffer+0x150/0x1c0 lib/scatterlist.c:831 Read of size 2132 at addr ffff8880aea95dc8 by task syz-executor.0/9815 CPU: 0 PID: 9815 Comm: syz-executor.0 Not tainted 4.19.202-00874-gfc0fe04215a9 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xe4/0x14a lib/dump_stack.c:118 print_address_description+0x73/0x280 mm/kasan/report.c:253 kasan_report_error mm/kasan/report.c:352 [inline] kasan_report+0x272/0x370 mm/kasan/report.c:410 memcpy+0x1f/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:377 [inline] sg_copy_buffer+0x150/0x1c0 lib/scatterlist.c:831 fill_from_dev_buffer+0x14f/0x340 drivers/scsi/scsi_debug.c:1021 resp_report_tgtpgs+0x5aa/0x770 drivers/scsi/scsi_debug.c:1772 schedule_resp+0x464/0x12f0 drivers/scsi/scsi_debug.c:4429 scsi_debug_queuecommand+0x467/0x1390 drivers/scsi/scsi_debug.c:5835 scsi_dispatch_cmd+0x3fc/0x9b0 drivers/scsi/scsi_lib.c:1896 scsi_request_fn+0x1042/0x1810 drivers/scsi/scsi_lib.c:2034 __blk_run_queue_uncond block/blk-core.c:464 [inline] __blk_run_queue+0x1a4/0x380 block/blk-core.c:484 blk_execute_rq_nowait+0x1c2/0x2d0 block/blk-exec.c:78 sg_common_write.isra.19+0xd74/0x1dc0 drivers/scsi/sg.c:847 sg_write.part.23+0x6e0/0xd00 drivers/scsi/sg.c:716 sg_write+0x64/0xa0 drivers/scsi/sg.c:622 __vfs_write+0xed/0x690 fs/read_write.c:485 kill_bdev:block_device:00000000e138492c vfs_write+0x184/0x4c0 fs/read_write.c:549 ksys_write+0x107/0x240 fs/read_write.c:599 do_syscall_64+0xc2/0x560 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe We get 'alen' from command its type is int. If userspace passes a large length we will get a negative 'alen'. Switch n, alen, and rlen to u32.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.15.5
- Published
- 2024-04-10
Affected versions
From: 5.11
Until: 5.15.5
Fixed in: 5.15.5
How to fix this CVE
Update your Linux kernel to version 5.15.5 or later to resolve a memory access vulnerability in the SCSI debug module's target port group reporting function. The vulnerability allows a local privileged user to trigger an out-of-bounds read by passing a crafted large length value, potentially causing denial of service or information disclosure. Apply the kernel update through your distribution's package manager and reboot the system to complete remediation.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check your current kernel version by running 'uname -r' and verify it is 5.15.5 or later
- Step 2: Confirm scsi_debug module is loaded with 'lsmod | grep scsi_debug' (only systems using SCSI debug emulation are affected)
- Step 3: Search kernel logs for KASAN errors with 'dmesg | grep -i "slab-out-of-bounds"' or 'journalctl -k | grep -i "KASAN"'
- Step 4: After applying the patch, verify the new kernel version with 'uname -r' and restart to confirm the update took effect
FAQ
What is CVE-2021-47219?
This vulnerability is an out-of-bounds memory read flaw in the Linux kernel's SCSI debug module, specifically in the resp_report_tgtpgs() function. A local user with privileges can craft malicious SCSI commands with large length parameters to trigger the memory violation, potentially causing system crashes or leaking sensitive kernel memory.
Is CVE-2021-47219 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are available. However, the flaw can be reliably triggered through fuzzing tools like syzkaller, making it a moderate risk for systems with untrusted local users.
What versions of Kernel are affected by CVE-2021-47219?
Linux kernel versions 5.11 through 5.15.4 are vulnerable. The fix is included in kernel 5.15.5 and all subsequent releases.
How do I check if my server is vulnerable to CVE-2021-47219?
Run 'uname -r' to check your kernel version. If it returns a version between 5.11 and 5.15.4, your system is vulnerable. Additionally, check if scsi_debug is loaded with 'lsmod | grep scsi_debug'—only systems with this module active can be exploited.
Does Defensia detect CVE-2021-47219?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2021-47219 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/66523553fa62c7878fc5441dc4e82be71934eb77
- https://git.kernel.org/stable/c/8440377e1a5644779b4c8d013aa2a917f5fc83c3
- https://git.kernel.org/stable/c/f347c26836c270199de1599c3cd466bb7747caa9
- https://git.kernel.org/stable/c/66523553fa62c7878fc5441dc4e82be71934eb77
- https://git.kernel.org/stable/c/8440377e1a5644779b4c8d013aa2a917f5fc83c3
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47219. Free for 1 server.
Get started free