# CVE-2024-35896: netfilter: validate user input for expected length

> 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.33% (percentile 18, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2024-05-19T08:34:51.034Z
- **Modified:** 2026-10-15T01:17:50.840Z

## Who should check

- Anyone running Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 0f038242b77ddfc505bf4163d4904c1abd2e74d6; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 440e948cf0eff32cfe322dcbca3f2525354b159b; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 18aae2cb87e5faa9c5bd865260ceadac60d5a6c5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 81d51b9b7c95e791ba3c1a2dd77920a9d3b3f525; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 58f2bfb789e6bd3bc24a2c9c1580f3c67aec3018; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 0c83842df40f86e529db6842231154772c20edcc
- Anyone running Linux 2.6.12

## Description

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

netfilter: validate user input for expected length

I got multiple syzbot reports showing old bugs exposed
by BPF after commit 20f2505fb436 ("bpf: Try to avoid kzalloc
in cgroup/{s,g}etsockopt")

setsockopt() @optlen argument should be taken into account
before copying data.

 BUG: KASAN: slab-out-of-bounds in copy\_from\_sockptr\_offset include/linux/sockptr.h:49 \[inline\]
 BUG: KASAN: slab-out-of-bounds in copy\_from\_sockptr include/linux/sockptr.h:55 \[inline\]
 BUG: KASAN: slab-out-of-bounds in do\_replace net/ipv4/netfilter/ip\_tables.c:1111 \[inline\]
 BUG: KASAN: slab-out-of-bounds in do\_ipt\_set\_ctl+0x902/0x3dd0 net/ipv4/netfilter/ip\_tables.c:1627
Read of size 96 at addr ffff88802cd73da0 by task syz-executor.4/7238

CPU: 1 PID: 7238 Comm: syz-executor.4 Not tainted 6.9.0-rc2-next-20240403-syzkaller \#0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 \<TASK\>
  \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
  dump\_stack\_lvl+0x241/0x360 lib/dump\_stack.c:114
  print\_address\_description mm/kasan/report.c:377 \[inline\]
  print\_report+0x169/0x550 mm/kasan/report.c:488
  kasan\_report+0x143/0x180 mm/kasan/report.c:601
  kasan\_check\_range+0x282/0x290 mm/kasan/generic.c:189
  \_\_asan\_memcpy+0x29/0x70 mm/kasan/shadow.c:105
  copy\_from\_sockptr\_offset include/linux/sockptr.h:49 \[inline\]
  copy\_from\_sockptr include/linux/sockptr.h:55 \[inline\]
  do\_replace net/ipv4/netfilter/ip\_tables.c:1111 \[inline\]
  do\_ipt\_set\_ctl+0x902/0x3dd0 net/ipv4/netfilter/ip\_tables.c:1627
  nf\_setsockopt+0x295/0x2c0 net/netfilter/nf\_sockopt.c:101
  do\_sock\_setsockopt+0x3af/0x720 net/socket.c:2311
  \_\_sys\_setsockopt+0x1ae/0x250 net/socket.c:2334
  \_\_do\_sys\_setsockopt net/socket.c:2343 \[inline\]
  \_\_se\_sys\_setsockopt net/socket.c:2340 \[inline\]
  \_\_x64\_sys\_setsockopt+0xb5/0xd0 net/socket.c:2340
 do\_syscall\_64+0xfb/0x240
 entry\_SYSCALL\_64\_after\_hwframe+0x72/0x7a
RIP: 0033:0x7fd22067dde9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd21f9ff0c8 EFLAGS: 00000246 ORIG\_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007fd2207abf80 RCX: 00007fd22067dde9
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007fd2206ca47a R08: 0000000000000001 R09: 0000000000000000
R10: 0000000020000880 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fd2207abf80 R15: 00007ffd2d0170d8
 \</TASK\>

Allocated by task 7238:
  kasan\_save\_stack mm/kasan/common.c:47 \[inline\]
  kasan\_save\_track+0x3f/0x80 mm/kasan/common.c:68
  poison\_kmalloc\_redzone mm/kasan/common.c:370 \[inline\]
  \_\_kasan\_kmalloc+0x98/0xb0 mm/kasan/common.c:387
  kasan\_kmalloc include/linux/kasan.h:211 \[inline\]
  \_\_do\_kmalloc\_node mm/slub.c:4069 \[inline\]
  \_\_kmalloc\_noprof+0x200/0x410 mm/slub.c:4082
  kmalloc\_noprof include/linux/slab.h:664 \[inline\]
  \_\_cgroup\_bpf\_run\_filter\_setsockopt+0xd47/0x1050 kernel/bpf/cgroup.c:1869
  do\_sock\_setsockopt+0x6b4/0x720 net/socket.c:2293
  \_\_sys\_setsockopt+0x1ae/0x250 net/socket.c:2334
  \_\_do\_sys\_setsockopt net/socket.c:2343 \[inline\]
  \_\_se\_sys\_setsockopt net/socket.c:2340 \[inline\]
  \_\_x64\_sys\_setsockopt+0xb5/0xd0 net/socket.c:2340
 do\_syscall\_64+0xfb/0x240
 entry\_SYSCALL\_64\_after\_hwframe+0x72/0x7a

The buggy address belongs to the object at ffff88802cd73da0
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
 allocated 1-byte region \[ffff88802cd73da0, ffff88802cd73da1)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802cd73020 pfn:0x2cd73
flags: 0xfff80000000000(node=0\|zone=1\|lastcpupid=0xfff)
page\_type: 0xffffefff(slab)
raw: 00fff80000000000 ffff888015041280 dead000000000100 dead000000000122
raw: ffff88802cd73020 000000008080007f 00000001ffffefff 00
---truncated---

## Affected and fixed versions

- Linux: \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 0f038242b77ddfc505bf4163d4904c1abd2e74d6; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 440e948cf0eff32cfe322dcbca3f2525354b159b; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 18aae2cb87e5faa9c5bd865260ceadac60d5a6c5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 81d51b9b7c95e791ba3c1a2dd77920a9d3b3f525; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 58f2bfb789e6bd3bc24a2c9c1580f3c67aec3018; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 0c83842df40f86e529db6842231154772c20edcc (cvelist)
- Linux: 2.6.12 (cvelist)

## Mitigation

- Upgrade Linux to 0c83842df40f86e529db6842231154772c20edcc or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-35896.md
Affected: Linux >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 0f038242b77ddfc505bf4163d4904c1abd2e74d6; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 440e948cf0eff32cfe322dcbca3f2525354b159b; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 18aae2cb87e5faa9c5bd865260ceadac60d5a6c5; >= 1da177e4c3f41524e886b7f…
Fixed in: Linux 0f038242b77ddfc505bf4163d4904c1abd2e74d6, Linux 440e948cf0eff32cfe322dcbca3f2525354b159b, Linux 18aae2cb87e5faa9c5bd865260ceadac60d5a6c5, Linux 81d51b9b7c95e791ba3c1a2dd77920a9d3b3f525, Linux 58f2bfb789e6bd3bc24a2c9c1580f3c67aec3018, Linux 0c83842df40f86e529db6842231154772c20edcc

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-2024-35896 being exploited?

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

### How serious is CVE-2024-35896?

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

### Which versions are affected by CVE-2024-35896?

Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 0f038242b77ddfc505bf4163d4904c1abd2e74d6; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 440e948cf0eff32cfe322dcbca3f2525354b159b; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 18aae2cb87e5faa9c5bd865260ceadac60d5a6c5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 81d51b9b7c95e791ba3c1a2dd77920a9d3b3f525; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 58f2bfb789e6bd3bc24a2c9c1580f3c67aec3018; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 0c83842df40f86e529db6842231154772c20edcc; Linux 2.6.12.

### Is there a fix for CVE-2024-35896?

Yes. Fixed in Linux 0f038242b77ddfc505bf4163d4904c1abd2e74d6, Linux 440e948cf0eff32cfe322dcbca3f2525354b159b, Linux 18aae2cb87e5faa9c5bd865260ceadac60d5a6c5, Linux 81d51b9b7c95e791ba3c1a2dd77920a9d3b3f525, Linux 58f2bfb789e6bd3bc24a2c9c1580f3c67aec3018, Linux 0c83842df40f86e529db6842231154772c20edcc. Upgrade Linux to 0c83842df40f86e529db6842231154772c20edcc or later.

### How do I check if I'm affected by CVE-2024-35896?

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/0f038242b77ddfc505bf4163d4904c1abd2e74d6>
- patch: <https://git.kernel.org/stable/c/440e948cf0eff32cfe322dcbca3f2525354b159b>
- patch: <https://git.kernel.org/stable/c/18aae2cb87e5faa9c5bd865260ceadac60d5a6c5>
- patch: <https://git.kernel.org/stable/c/81d51b9b7c95e791ba3c1a2dd77920a9d3b3f525>
- patch: <https://git.kernel.org/stable/c/58f2bfb789e6bd3bc24a2c9c1580f3c67aec3018>
- patch: <https://git.kernel.org/stable/c/0c83842df40f86e529db6842231154772c20edcc>
- other: <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html>
- other: <https://security.netapp.com/advisory/ntap-20250321-0004/>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>

## 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-2024-35896>

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