# CVE-2024-35970: af\_unix: Clear stale u-\>oob\_skb.

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

- **Severity:** MEDIUM 6.3
- **CVSS:** 6.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: Low; Availability impact: Low
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.68% (percentile 48, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-05-20T09:41:58.524Z
- **Modified:** 2026-06-17T07:35:50.623Z

## Who should check

- Anyone running Linux \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< b4bc99d04c689b5652665394ae8d3e02fb754153; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 84a352b7eba1142a95441380058985ff19f25ec9; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 601a89ea24d05089debfa2dc896ea9f5937ac7a6; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 698a95ade1a00e6494482046902b986dfffd1caf; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< b46f4eaa4f0ec38909fb0072eea3aeddb32f954e
- Anyone running Linux 5.15

## Description

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

af\_unix: Clear stale u-\>oob\_skb.

syzkaller started to report deadlock of unix\_gc\_lock after commit
4090fa373f0e ("af\_unix: Replace garbage collection algorithm."), but
it just uncovers the bug that has been there since commit 314001f0bf92
("af\_unix: Add OOB support").

The repro basically does the following.

  from socket import \*
  from array import array

  c1, c2 = socketpair(AF\_UNIX, SOCK\_STREAM)
  c1.sendmsg(\[b'a'\], \[(SOL\_SOCKET, SCM\_RIGHTS, array("i", \[c2.fileno()\]))\], MSG\_OOB)
  c2.recv(1)  \# blocked as no normal data in recv queue

  c2.close()  \# done async and unblock recv()
  c1.close()  \# done async and trigger GC

A socket sends its file descriptor to itself as OOB data and tries to
receive normal data, but finally recv() fails due to async close().

The problem here is wrong handling of OOB skb in manage\_oob().  When
recvmsg() is called without MSG\_OOB, manage\_oob() is called to check
if the peeked skb is OOB skb.  In such a case, manage\_oob() pops it
out of the receive queue but does not clear unix\_sock(sk)-\>oob\_skb.
This is wrong in terms of uAPI.

Let's say we send "hello" with MSG\_OOB, and "world" without MSG\_OOB.
The 'o' is handled as OOB data.  When recv() is called twice without
MSG\_OOB, the OOB data should be lost.

  \>\>\> from socket import \*
  \>\>\> c1, c2 = socketpair(AF\_UNIX, SOCK\_STREAM, 0)
  \>\>\> c1.send(b'hello', MSG\_OOB)  \# 'o' is OOB data
  5
  \>\>\> c1.send(b'world')
  5
  \>\>\> c2.recv(5)  \# OOB data is not received
  b'hell'
  \>\>\> c2.recv(5)  \# OOB date is skipped
  b'world'
  \>\>\> c2.recv(5, MSG\_OOB)  \# This should return an error
  b'o'

In the same situation, TCP actually returns -EINVAL for the last
recv().

Also, if we do not clear unix\_sk(sk)-\>oob\_skb, unix\_poll() always set
EPOLLPRI even though the data has passed through by previous recv().

To avoid these issues, we must clear unix\_sk(sk)-\>oob\_skb when dequeuing
it from recv queue.

The reason why the old GC did not trigger the deadlock is because the
old GC relied on the receive queue to detect the loop.

When it is triggered, the socket with OOB data is marked as GC candidate
because file refcount == inflight count (1).  However, after traversing
all inflight sockets, the socket still has a positive inflight count (1),
thus the socket is excluded from candidates.  Then, the old GC lose the
chance to garbage-collect the socket.

With the old GC, the repro continues to create true garbage that will
never be freed nor detected by kmemleak as it's linked to the global
inflight list.  That's why we couldn't even notice the issue.

## Affected and fixed versions

- Linux: \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< b4bc99d04c689b5652665394ae8d3e02fb754153; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 84a352b7eba1142a95441380058985ff19f25ec9; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 601a89ea24d05089debfa2dc896ea9f5937ac7a6; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 698a95ade1a00e6494482046902b986dfffd1caf; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< b46f4eaa4f0ec38909fb0072eea3aeddb32f954e (cvelist)
- Linux: 5.15 (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-2024-35970. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-35970.md
Affected: Linux >= 314001f0bf927015e459c9d387d62a231fe93af3, < b4bc99d04c689b5652665394ae8d3e02fb754153; >= 314001f0bf927015e459c9d387d62a231fe93af3, < 84a352b7eba1142a95441380058985ff19f25ec9; >= 314001f0bf927015e459c9d387d62a231fe93af3, < 601a89ea24d05089debfa2dc896ea9f5937ac7a6; >= 314001f0bf927015e459c9d…
Fixed in: Linux 84a352b7eba1142a95441380058985ff19f25ec9, Linux 601a89ea24d05089debfa2dc896ea9f5937ac7a6, Linux 698a95ade1a00e6494482046902b986dfffd1caf

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

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

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

Medium: CVSS 6.3 (v3.1, scored by CNA). Remote, login needed.

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

Linux \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< b4bc99d04c689b5652665394ae8d3e02fb754153; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 84a352b7eba1142a95441380058985ff19f25ec9; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 601a89ea24d05089debfa2dc896ea9f5937ac7a6; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< 698a95ade1a00e6494482046902b986dfffd1caf; \>= 314001f0bf927015e459c9d387d62a231fe93af3, \< b46f4eaa4f0ec38909fb0072eea3aeddb32f954e; Linux 5.15.

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

Yes. Fixed in Linux 84a352b7eba1142a95441380058985ff19f25ec9, Linux 601a89ea24d05089debfa2dc896ea9f5937ac7a6, Linux 698a95ade1a00e6494482046902b986dfffd1caf. No fix listed yet: follow the vendor advisory.

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

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/b4bc99d04c689b5652665394ae8d3e02fb754153>
- patch: <https://git.kernel.org/stable/c/84a352b7eba1142a95441380058985ff19f25ec9>
- patch: <https://git.kernel.org/stable/c/601a89ea24d05089debfa2dc896ea9f5937ac7a6>
- patch: <https://git.kernel.org/stable/c/698a95ade1a00e6494482046902b986dfffd1caf>
- patch: <https://git.kernel.org/stable/c/b46f4eaa4f0ec38909fb0072eea3aeddb32f954e>

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

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