CVE-2021-47576: scsi: scsi_debug: Sanity check block descriptor length in resp_mode_select()
In the Linux kernel, the following vulnerability has been resolved:
scsi: scsidebug: Sanity check block descriptor length in respmodeselect()
In respmodeselect() sanity check the block descriptor len to avoid UAF.
BUG: KASAN: use-after-free in respmodeselect+0xa4c/0xb40 drivers/scsi/scsidebug.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> dumpstacklvl+0x89/0xb5 lib/dumpstack.c:107 printaddressdescription.constprop.9+0x28/0x160 mm/kasan/report.c:257 kasanreport.cold.14+0x7d/0x117 mm/kasan/report.c:443 asanreportload1noabort+0x14/0x20 mm/kasan/reportgeneric.c:306 respmodeselect+0xa4c/0xb40 drivers/scsi/scsidebug.c:2509 scheduleresp+0x4af/0x1a10 drivers/scsi/scsidebug.c:5483 scsidebugqueuecommand+0x8c9/0x1e70 drivers/scsi/scsidebug.c:7537 scsiqueuerq+0x16b4/0x2d10 drivers/scsi/scsilib.c:1521 blkmqdispatchrqlist+0xb9b/0x2700 block/blk-mq.c:1640 blkmqscheddispatchrequests+0x28f/0x590 block/blk-mq-sched.c:325 blkmqscheddispatchrequests+0x105/0x190 block/blk-mq-sched.c:358 blkmqrunhwqueue+0xe5/0x150 block/blk-mq.c:1762 blkmqdelayrunhwqueue+0x4f8/0x5c0 block/blk-mq.c:1839 blkmqrunhwqueue+0x18d/0x350 block/blk-mq.c:1891 blkmqschedinsertrequest+0x3db/0x4e0 block/blk-mq-sched.c:474 blkexecuterqnowait+0x16b/0x1c0 block/blk-exec.c:63 sgcommonwrite.isra.18+0xeb3/0x2000 drivers/scsi/sg.c:837 sgnewwrite.isra.19+0x570/0x8c0 drivers/scsi/sg.c:775 sgioctlcommon+0x14d6/0x2710 drivers/scsi/sg.c:941 sgioctl+0xa2/0x180 drivers/scsi/sg.c:1166 x64sysioctl+0x19d/0x220 fs/ioctl.c:52 dosyscall64+0x3a/0x80 arch/x86/entry/common.c:50 entrySYSCALL64afterhwframe+0x44/0xae arch/x86/entry/entry64.S:113
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 4.15.0-1131.144~14.04.1 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 4.4.0-1145.151 - Upgrade
Upgrade
ubuntu/linux-lts-xenialto a version that resolves this vulnerability.Fixed in 4.4.0-270.304~14.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 4.4.0-270.304 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 4.4.0-1183.198 - Upgrade
Upgrade
ubuntu/linux-aws-hweto a version that resolves this vulnerability.Fixed in 4.15.0-1120.128~16.04.1 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 4.15.0-1131.144~16.04.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 4.15.0-1116.130~16.04.1 - Upgrade
Upgrade
ubuntu/linux-hweto a version that resolves this vulnerability.Fixed in 4.15.0-169.177~16.04.1 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 4.4.0-1146.157 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 4.15.0-1087.95~16.04.1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 4.4.0-1115.122 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 4.15.0-169.177 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 4.15.0-1121.129 - Upgrade
Upgrade
ubuntu/linux-aws-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1069.73~18.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-4.15to a version that resolves this vulnerability.Fixed in 4.15.0-1131.144 - Upgrade
Upgrade
ubuntu/linux-azure-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1073.76~18.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-4.15to a version that resolves this vulnerability.Fixed in 4.15.0-1116.130 - Upgrade
Upgrade
ubuntu/linux-gcp-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1068.72~18.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-105.119~18.04.1 - Upgrade
Upgrade
ubuntu/linux-ibm-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1018.20~18.04.1 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 4.15.0-1107.109 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 4.15.0-1087.95 - Upgrade
Upgrade
ubuntu/linux-oracle-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1067.72~18.04.1 - Upgrade
Upgrade
ubuntu/linux-raspi-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1056.63~18.04.1 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-2061.63 - Upgrade
Upgrade
ubuntu/linux-azure-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-2043.47 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-1078.87 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-2026.28 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.4.0-105.119 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.4.0-1069.73 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.4.0-1073.76 - Upgrade
Upgrade
ubuntu/linux-bluefieldto a version that resolves this vulnerability.Fixed in 5.4.0-1032.35 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.4.0-1068.72 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.4.0-1037.38 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.4.0-1018.20 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.4.0-1059.62 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.4.0-1067.72 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.4.0-1056.63 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1069.73+fips2 - Upgrade
Upgrade
ubuntu/linux-azure-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1073.76+fips1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1046.52 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1067.71~20.04.1 - Compensating control
In the Linux kernel scsi_debug driver, update resp_mode_select() to sanity-check the block descriptor length before using it, preventing the use-after-free.
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47576?
CVE-2021-47576 is categorized as a medium severity vulnerability due to its potential for causing system instability through a use-after-free condition.
How do I fix CVE-2021-47576?
To fix CVE-2021-47576, update to a version of the Linux kernel that is above 4.9.294 or in the specified non-vulnerable ranges.
Which versions of Linux Kernel are vulnerable to CVE-2021-47576?
Versions of the Linux kernel from 4.10 to 4.14.259, 4.15 to 4.19.222, 4.20 to 5.4.168, 5.5 to 5.10.88, and 5.11 to 5.15.11 are vulnerable to CVE-2021-47576.
What type of vulnerability is CVE-2021-47576?
CVE-2021-47576 is a use-after-free vulnerability that occurs in the `resp_mode_select()` function of the Linux kernel SCSI subsystem.
Which component of the operating system is affected by CVE-2021-47576?
CVE-2021-47576 affects the SCSI subsystem of the Linux kernel.