# CVE-2024-39500: sock\_map: avoid race between sock\_map\_close and sk\_psock\_put

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.25% (percentile 10, 2026-11-28)
- **CWE:** CWE-362, CWE-617
- **Published:** 2024-07-12T12:20:34.317Z
- **Modified:** 2026-08-05T11:33:47.078Z

## Who should check

- Anyone running Linux \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 4959ffc65a0e94f8acaac20deac49f89e6ded52d; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 5eabdf17fed2ad41b836bb4055ec36d95e512c50; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< e946428439a0d2079959f5603256ac51b6047017; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 3627605de498639a3c586c8684d12c89cba11073; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 4b4647add7d3c8530493f7247d11e257ee425bf0; c4896f5fd83664a50ac4fef4131a265d15734e5a; \>= 5.10.248, \< 5.11
- Anyone running Linux 5.13

## Description

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

sock\_map: avoid race between sock\_map\_close and sk\_psock\_put

sk\_psock\_get will return NULL if the refcount of psock has gone to 0, which
will happen when the last call of sk\_psock\_put is done. However,
sk\_psock\_drop may not have finished yet, so the close callback will still
point to sock\_map\_close despite psock being NULL.

This can be reproduced with a thread deleting an element from the sock map,
while the second one creates a socket, adds it to the map and closes it.

That will trigger the WARN\_ON\_ONCE:

------------\[ cut here \]------------
WARNING: CPU: 1 PID: 7220 at net/core/sock\_map.c:1701 sock\_map\_close+0x2a2/0x2d0 net/core/sock\_map.c:1701
Modules linked in:
CPU: 1 PID: 7220 Comm: syz-executor380 Not tainted 6.9.0-syzkaller-07726-g3c999d1ae3c7 \#0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:sock\_map\_close+0x2a2/0x2d0 net/core/sock\_map.c:1701
Code: df e8 92 29 88 f8 48 8b 1b 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 79 29 88 f8 4c 8b 23 eb 89 e8 4f 15 23 f8 90 \<0f\> 0b 90 48 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d e9 13 26 3d 02
RSP: 0018:ffffc9000441fda8 EFLAGS: 00010293
RAX: ffffffff89731ae1 RBX: ffffffff94b87540 RCX: ffff888029470000
RDX: 0000000000000000 RSI: ffffffff8bcab5c0 RDI: ffffffff8c1faba0
RBP: 0000000000000000 R08: ffffffff92f9b61f R09: 1ffffffff25f36c3
R10: dffffc0000000000 R11: fffffbfff25f36c4 R12: ffffffff89731840
R13: ffff88804b587000 R14: ffff88804b587000 R15: ffffffff89731870
FS:  000055555e080380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000207d4000 CR4: 0000000000350ef0
Call Trace:
 \<TASK\>
 unix\_release+0x87/0xc0 net/unix/af\_unix.c:1048
 \_\_sock\_release net/socket.c:659 \[inline\]
 sock\_close+0xbe/0x240 net/socket.c:1421
 \_\_fput+0x42b/0x8a0 fs/file\_table.c:422
 \_\_do\_sys\_close fs/open.c:1556 \[inline\]
 \_\_se\_sys\_close fs/open.c:1541 \[inline\]
 \_\_x64\_sys\_close+0x7f/0x110 fs/open.c:1541
 do\_syscall\_x64 arch/x86/entry/common.c:52 \[inline\]
 do\_syscall\_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
RIP: 0033:0x7fb37d618070
Code: 00 00 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d4 e8 10 2c 00 00 80 3d 31 f0 07 00 00 74 17 b8 03 00 00 00 0f 05 \<48\> 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c
RSP: 002b:00007ffcd4a525d8 EFLAGS: 00000202 ORIG\_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007fb37d618070
RDX: 0000000000000010 RSI: 00000000200001c0 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000100000000 R09: 0000000100000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 \</TASK\>

Use sk\_psock, which will only check that the pointer is not been set to
NULL yet, which should only happen after the callbacks are restored. If,
then, a reference can still be gotten, we may call sk\_psock\_stop and cancel
psock-\>work.

As suggested by Paolo Abeni, reorder the condition so the control flow is
less convoluted.

After that change, the reproducer does not trigger the WARN\_ON\_ONCE
anymore.

## Affected and fixed versions

- Linux: \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 4959ffc65a0e94f8acaac20deac49f89e6ded52d; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 5eabdf17fed2ad41b836bb4055ec36d95e512c50; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< e946428439a0d2079959f5603256ac51b6047017; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 3627605de498639a3c586c8684d12c89cba11073; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 4b4647add7d3c8530493f7247d11e257ee425bf0; c4896f5fd83664a50ac4fef4131a265d15734e5a; \>= 5.10.248, \< 5.11 (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- Upgrade Linux to 5.11 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-39500. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-39500.md
Affected: Linux >= aadb2bb83ff789de63b48b4edeab7329423a50d3, < 4959ffc65a0e94f8acaac20deac49f89e6ded52d; >= aadb2bb83ff789de63b48b4edeab7329423a50d3, < 5eabdf17fed2ad41b836bb4055ec36d95e512c50; >= aadb2bb83ff789de63b48b4edeab7329423a50d3, < e946428439a0d2079959f5603256ac51b6047017; >= aadb2bb83ff789de63b48b4…
Fixed in: Linux 4959ffc65a0e94f8acaac20deac49f89e6ded52d, Linux 5eabdf17fed2ad41b836bb4055ec36d95e512c50, Linux 3627605de498639a3c586c8684d12c89cba11073, Linux 4b4647add7d3c8530493f7247d11e257ee425bf0, Linux 5.11

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

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

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

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

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

Linux \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 4959ffc65a0e94f8acaac20deac49f89e6ded52d; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 5eabdf17fed2ad41b836bb4055ec36d95e512c50; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< e946428439a0d2079959f5603256ac51b6047017; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 3627605de498639a3c586c8684d12c89cba11073; \>= aadb2bb83ff789de63b48b4edeab7329423a50d3, \< 4b4647add7d3c8530493f7247d11e257ee425bf0; c4896f5fd83664a50ac4fef4131a265d15734e5a; \>= 5.10.248, \< 5.11; Linux 5.13.

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

Yes. Fixed in Linux 4959ffc65a0e94f8acaac20deac49f89e6ded52d, Linux 5eabdf17fed2ad41b836bb4055ec36d95e512c50, Linux 3627605de498639a3c586c8684d12c89cba11073, Linux 4b4647add7d3c8530493f7247d11e257ee425bf0, Linux 5.11. Upgrade Linux to 5.11 or later.

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

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/4959ffc65a0e94f8acaac20deac49f89e6ded52d>
- patch: <https://git.kernel.org/stable/c/5eabdf17fed2ad41b836bb4055ec36d95e512c50>
- patch: <https://git.kernel.org/stable/c/e946428439a0d2079959f5603256ac51b6047017>
- patch: <https://git.kernel.org/stable/c/3627605de498639a3c586c8684d12c89cba11073>
- patch: <https://git.kernel.org/stable/c/4b4647add7d3c8530493f7247d11e257ee425bf0>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.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-39500>

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