# CVE-2021-46954: net/sched: sch\_frag: fix stack OOB read while fragmenting IPv4 packets

> 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, NVD) `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.23% (percentile 8, 2026-11-28)
- **CWE:** CWE-125
- **Published:** 2024-02-27T18:46:56.804Z
- **Modified:** 2026-06-17T04:15:58.120Z

## Who should check

- Anyone running Linux \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 018bb8da5b5888e19585f9b802f036afe643fcef; \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 8e6dfb7beeb6489ac1365b8a71052e737f5da76e; \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 31fe34a0118e0acc958c802e830ad5d37ef6b1d3
- Anyone running Linux 5.11

## Description

In the Linux kernel, the following vulnerability has been resolved:

net/sched: sch\_frag: fix stack OOB read while fragmenting IPv4 packets

when 'act\_mirred' tries to fragment IPv4 packets that had been previously
re-assembled using 'act\_ct', splats like the following can be observed on
kernels built with KASAN:

 BUG: KASAN: stack-out-of-bounds in ip\_do\_fragment+0x1b03/0x1f60
 Read of size 1 at addr ffff888147009574 by task ping/947

 CPU: 0 PID: 947 Comm: ping Not tainted 5.12.0-rc6+ \#418
 Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014
 Call Trace:
  \<IRQ\>
  dump\_stack+0x92/0xc1
  print\_address\_description.constprop.7+0x1a/0x150
  kasan\_report.cold.13+0x7f/0x111
  ip\_do\_fragment+0x1b03/0x1f60
  sch\_fragment+0x4bf/0xe40
  tcf\_mirred\_act+0xc3d/0x11a0 \[act\_mirred\]
  tcf\_action\_exec+0x104/0x3e0
  fl\_classify+0x49a/0x5e0 \[cls\_flower\]
  tcf\_classify\_ingress+0x18a/0x820
  \_\_netif\_receive\_skb\_core+0xae7/0x3340
  \_\_netif\_receive\_skb\_one\_core+0xb6/0x1b0
  process\_backlog+0x1ef/0x6c0
  \_\_napi\_poll+0xaa/0x500
  net\_rx\_action+0x702/0xac0
  \_\_do\_softirq+0x1e4/0x97f
  do\_softirq+0x71/0x90
  \</IRQ\>
  \_\_local\_bh\_enable\_ip+0xdb/0xf0
  ip\_finish\_output2+0x760/0x2120
  ip\_do\_fragment+0x15a5/0x1f60
  \_\_ip\_finish\_output+0x4c2/0xea0
  ip\_output+0x1ca/0x4d0
  ip\_send\_skb+0x37/0xa0
  raw\_sendmsg+0x1c4b/0x2d00
  sock\_sendmsg+0xdb/0x110
  \_\_sys\_sendto+0x1d7/0x2b0
  \_\_x64\_sys\_sendto+0xdd/0x1b0
  do\_syscall\_64+0x33/0x40
  entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
 RIP: 0033:0x7f82e13853eb
 Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 f3 0f 1e fa 48 8d 05 75 42 2c 00 41 89 ca 8b 00 85 c0 75 14 b8 2c 00 00 00 0f 05 \<48\> 3d 00 f0 ff ff 77 75 c3 0f 1f 40 00 41 57 4d 89 c7 41 56 41 89
 RSP: 002b:00007ffe01fad888 EFLAGS: 00000246 ORIG\_RAX: 000000000000002c
 RAX: ffffffffffffffda RBX: 00005571aac13700 RCX: 00007f82e13853eb
 RDX: 0000000000002330 RSI: 00005571aac13700 RDI: 0000000000000003
 RBP: 0000000000002330 R08: 00005571aac10500 R09: 0000000000000010
 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe01faefb0
 R13: 00007ffe01fad890 R14: 00007ffe01fad980 R15: 00005571aac0f0a0

 The buggy address belongs to the page:
 page:000000001dff2e03 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x147009
 flags: 0x17ffffc0001000(reserved)
 raw: 0017ffffc0001000 ffffea00051c0248 ffffea00051c0248 0000000000000000
 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
 page dumped because: kasan: bad access detected

 Memory state around the buggy address:
  ffff888147009400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  ffff888147009480: f1 f1 f1 f1 04 f2 f2 f2 f2 f2 f2 f2 00 00 00 00
 \>ffff888147009500: 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 f2 f2
                                                              ^
  ffff888147009580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  ffff888147009600: 00 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2

for IPv4 packets, sch\_fragment() uses a temporary struct dst\_entry. Then,
in the following call graph:

  ip\_do\_fragment()
    ip\_skb\_dst\_mtu()
      ip\_dst\_mtu\_maybe\_forward()
        ip\_mtu\_locked()

the pointer to struct dst\_entry is used as pointer to struct rtable: this
turns the access to struct members like rt\_mtu\_locked into an OOB read in
the stack. Fix this changing the temporary variable used for IPv4 packets
in sch\_fragment(), similarly to what is done for IPv6 few lines below.

## Affected and fixed versions

- Linux: \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 018bb8da5b5888e19585f9b802f036afe643fcef; \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 8e6dfb7beeb6489ac1365b8a71052e737f5da76e; \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 31fe34a0118e0acc958c802e830ad5d37ef6b1d3 (cvelist)
- Linux: 5.11 (cvelist)

## Mitigation

- Upgrade Linux to 31fe34a0118e0acc958c802e830ad5d37ef6b1d3 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-46954.md
Affected: Linux >= c129412f74e99b609f0a8e95fc3915af1fd40f34, < 018bb8da5b5888e19585f9b802f036afe643fcef; >= c129412f74e99b609f0a8e95fc3915af1fd40f34, < 8e6dfb7beeb6489ac1365b8a71052e737f5da76e; >= c129412f74e99b609f0a8e95fc3915af1fd40f34, < 31fe34a0118e0acc958c802e830ad5d37ef6b1d3; Linux 5.11
Fixed in: Linux 018bb8da5b5888e19585f9b802f036afe643fcef, Linux 8e6dfb7beeb6489ac1365b8a71052e737f5da76e, Linux 31fe34a0118e0acc958c802e830ad5d37ef6b1d3

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-46954 being exploited?

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

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

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

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

Linux \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 018bb8da5b5888e19585f9b802f036afe643fcef; \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 8e6dfb7beeb6489ac1365b8a71052e737f5da76e; \>= c129412f74e99b609f0a8e95fc3915af1fd40f34, \< 31fe34a0118e0acc958c802e830ad5d37ef6b1d3; Linux 5.11.

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

Yes. Fixed in Linux 018bb8da5b5888e19585f9b802f036afe643fcef, Linux 8e6dfb7beeb6489ac1365b8a71052e737f5da76e, Linux 31fe34a0118e0acc958c802e830ad5d37ef6b1d3. Upgrade Linux to 31fe34a0118e0acc958c802e830ad5d37ef6b1d3 or later.

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

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/018bb8da5b5888e19585f9b802f036afe643fcef>
- patch: <https://git.kernel.org/stable/c/8e6dfb7beeb6489ac1365b8a71052e737f5da76e>
- patch: <https://git.kernel.org/stable/c/31fe34a0118e0acc958c802e830ad5d37ef6b1d3>

## 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-46954>

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