# CVE-2021-47219: scsi: scsi\_debug: Fix out-of-bound read in resp\_report\_tgtpgs()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2024-04-10T19:01:57.694Z
- **Modified:** 2026-08-05T08:46:46.676Z

## Who should check

- Anyone running Linux \>= 5a09e39810ae0465016c380962e12dd115779b87, \< 8440377e1a5644779b4c8d013aa2a917f5fc83c3; \>= 5a09e39810ae0465016c380962e12dd115779b87, \< 66523553fa62c7878fc5441dc4e82be71934eb77; \>= 5a09e39810ae0465016c380962e12dd115779b87, \< f347c26836c270199de1599c3cd466bb7747caa9
- Anyone running Linux 2.6.19

## Description

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.

## Affected and fixed versions

- Linux: \>= 5a09e39810ae0465016c380962e12dd115779b87, \< 8440377e1a5644779b4c8d013aa2a917f5fc83c3; \>= 5a09e39810ae0465016c380962e12dd115779b87, \< 66523553fa62c7878fc5441dc4e82be71934eb77; \>= 5a09e39810ae0465016c380962e12dd115779b87, \< f347c26836c270199de1599c3cd466bb7747caa9 (cvelist)
- Linux: 2.6.19 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47219. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47219.md
Affected: Linux >= 5a09e39810ae0465016c380962e12dd115779b87, < 8440377e1a5644779b4c8d013aa2a917f5fc83c3; >= 5a09e39810ae0465016c380962e12dd115779b87, < 66523553fa62c7878fc5441dc4e82be71934eb77; >= 5a09e39810ae0465016c380962e12dd115779b87, < f347c26836c270199de1599c3cd466bb7747caa9; Linux 2.6.19
Fixed in: Linux 8440377e1a5644779b4c8d013aa2a917f5fc83c3, Linux 66523553fa62c7878fc5441dc4e82be71934eb77

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47219 being exploited?

There is no confirmed exploitation: CVE-2021-47219 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47219?

High: CVSS 7.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47219?

Linux \>= 5a09e39810ae0465016c380962e12dd115779b87, \< 8440377e1a5644779b4c8d013aa2a917f5fc83c3; \>= 5a09e39810ae0465016c380962e12dd115779b87, \< 66523553fa62c7878fc5441dc4e82be71934eb77; \>= 5a09e39810ae0465016c380962e12dd115779b87, \< f347c26836c270199de1599c3cd466bb7747caa9; Linux 2.6.19.

### Is there a fix for CVE-2021-47219?

Yes. Fixed in Linux 8440377e1a5644779b4c8d013aa2a917f5fc83c3, Linux 66523553fa62c7878fc5441dc4e82be71934eb77. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2021-47219?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/8440377e1a5644779b4c8d013aa2a917f5fc83c3>
- patch: <https://git.kernel.org/stable/c/66523553fa62c7878fc5441dc4e82be71934eb77>
- patch: <https://git.kernel.org/stable/c/f347c26836c270199de1599c3cd466bb7747caa9>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47219>

HTML: <https://flawdb.com/CVE-2021-47219> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47219>
