# CVE-2023-53857: bpf: bpf\_sk\_storage: Fix invalid wait context lockdep report

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.27% (percentile 13, 2026-11-28)
- **Published:** 2025-12-09T01:30:23.593Z
- **Modified:** 2026-10-03T11:17:29.117Z

## Who should check

- Anyone running Linux \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< 47cf3387de902e8f61f705b06cb2fc1315d26932; \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< 300415caa373a07782fcbc2f8d9429bc2dc27a47; \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< a96a44aba556c42b432929d37d60158aca21ad4c
- Anyone running Linux 5.18

## Description

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

bpf: bpf\_sk\_storage: Fix invalid wait context lockdep report

'./test\_progs -t test\_local\_storage' reported a splat:

\[   27.137569\] =============================
\[   27.138122\] \[ BUG: Invalid wait context \]
\[   27.138650\] 6.5.0-03980-gd11ae1b16b0a \#247 Tainted: G           O
\[   27.139542\] -----------------------------
\[   27.140106\] test\_progs/1729 is trying to lock:
\[   27.140713\] ffff8883ef047b88 (stock\_lock){-.-.}-{3:3}, at: local\_lock\_acquire+0x9/0x130
\[   27.141834\] other info that might help us debug this:
\[   27.142437\] context-{5:5}
\[   27.142856\] 2 locks held by test\_progs/1729:
\[   27.143352\]  \#0: ffffffff84bcd9c0 (rcu\_read\_lock){....}-{1:3}, at: rcu\_lock\_acquire+0x4/0x40
\[   27.144492\]  \#1: ffff888107deb2c0 (&storage-\>lock){..-.}-{2:2}, at: bpf\_local\_storage\_update+0x39e/0x8e0
\[   27.145855\] stack backtrace:
\[   27.146274\] CPU: 0 PID: 1729 Comm: test\_progs Tainted: G           O       6.5.0-03980-gd11ae1b16b0a \#247
\[   27.147550\] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
\[   27.149127\] Call Trace:
\[   27.149490\]  \<TASK\>
\[   27.149867\]  dump\_stack\_lvl+0x130/0x1d0
\[   27.152609\]  dump\_stack+0x14/0x20
\[   27.153131\]  \_\_lock\_acquire+0x1657/0x2220
\[   27.153677\]  lock\_acquire+0x1b8/0x510
\[   27.157908\]  local\_lock\_acquire+0x29/0x130
\[   27.159048\]  obj\_cgroup\_charge+0xf4/0x3c0
\[   27.160794\]  slab\_pre\_alloc\_hook+0x28e/0x2b0
\[   27.161931\]  \_\_kmem\_cache\_alloc\_node+0x51/0x210
\[   27.163557\]  \_\_kmalloc+0xaa/0x210
\[   27.164593\]  bpf\_map\_kzalloc+0xbc/0x170
\[   27.165147\]  bpf\_selem\_alloc+0x130/0x510
\[   27.166295\]  bpf\_local\_storage\_update+0x5aa/0x8e0
\[   27.167042\]  bpf\_fd\_sk\_storage\_update\_elem+0xdb/0x1a0
\[   27.169199\]  bpf\_map\_update\_value+0x415/0x4f0
\[   27.169871\]  map\_update\_elem+0x413/0x550
\[   27.170330\]  \_\_sys\_bpf+0x5e9/0x640
\[   27.174065\]  \_\_x64\_sys\_bpf+0x80/0x90
\[   27.174568\]  do\_syscall\_64+0x48/0xa0
\[   27.175201\]  entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8
\[   27.175932\] RIP: 0033:0x7effb40e41ad
\[   27.176357\] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 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 8b 0d8
\[   27.179028\] RSP: 002b:00007ffe64c21fc8 EFLAGS: 00000202 ORIG\_RAX: 0000000000000141
\[   27.180088\] RAX: ffffffffffffffda RBX: 00007ffe64c22768 RCX: 00007effb40e41ad
\[   27.181082\] RDX: 0000000000000020 RSI: 00007ffe64c22008 RDI: 0000000000000002
\[   27.182030\] RBP: 00007ffe64c21ff0 R08: 0000000000000000 R09: 00007ffe64c22788
\[   27.183038\] R10: 0000000000000064 R11: 0000000000000202 R12: 0000000000000000
\[   27.184006\] R13: 00007ffe64c22788 R14: 00007effb42a1000 R15: 0000000000000000
\[   27.184958\]  \</TASK\>

It complains about acquiring a local\_lock while holding a raw\_spin\_lock.
It means it should not allocate memory while holding a raw\_spin\_lock
since it is not safe for RT.

raw\_spin\_lock is needed because bpf\_local\_storage supports tracing
context. In particular for task local storage, it is easy to
get a "current" task PTR\_TO\_BTF\_ID in tracing bpf prog.
However, task (and cgroup) local storage has already been moved to
bpf mem allocator which can be used after raw\_spin\_lock.

The splat is for the sk storage. For sk (and inode) storage,
it has not been moved to bpf mem allocator. Using raw\_spin\_lock or not,
kzalloc(GFP\_ATOMIC) could theoretically be unsafe in tracing context.
However, the local storage helper requires a verifier accepted
sk pointer (PTR\_TO\_BTF\_ID), it is hypothetical if that (mean running
a bpf prog in a kzalloc unsafe context and also able to hold a verifier
accepted sk pointer) could happen.

This patch avoids kzalloc after raw\_spin\_lock to silent the splat.
There is an existing kzalloc before the raw\_spin\_lock. At that point,
a kzalloc is very likely required because a lookup has just been done
before. Thus, this patch always does the kzalloc before acq
---truncated---

## Affected and fixed versions

- Linux: \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< 47cf3387de902e8f61f705b06cb2fc1315d26932; \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< 300415caa373a07782fcbc2f8d9429bc2dc27a47; \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< a96a44aba556c42b432929d37d60158aca21ad4c (cvelist)
- Linux: 5.18 (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-2023-53857. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53857.md
Affected: Linux >= b00fa38a9c1cba044a32a601b49a55a18ed719d1, < 47cf3387de902e8f61f705b06cb2fc1315d26932; >= b00fa38a9c1cba044a32a601b49a55a18ed719d1, < 300415caa373a07782fcbc2f8d9429bc2dc27a47; >= b00fa38a9c1cba044a32a601b49a55a18ed719d1, < a96a44aba556c42b432929d37d60158aca21ad4c; Linux 5.18
Fixed in: Linux 47cf3387de902e8f61f705b06cb2fc1315d26932, Linux 300415caa373a07782fcbc2f8d9429bc2dc27a47

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-2023-53857 being exploited?

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

### How serious is CVE-2023-53857?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2023-53857?

Linux \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< 47cf3387de902e8f61f705b06cb2fc1315d26932; \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< 300415caa373a07782fcbc2f8d9429bc2dc27a47; \>= b00fa38a9c1cba044a32a601b49a55a18ed719d1, \< a96a44aba556c42b432929d37d60158aca21ad4c; Linux 5.18.

### Is there a fix for CVE-2023-53857?

Yes. Fixed in Linux 47cf3387de902e8f61f705b06cb2fc1315d26932, Linux 300415caa373a07782fcbc2f8d9429bc2dc27a47. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-53857?

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

- other: <https://git.kernel.org/stable/c/47cf3387de902e8f61f705b06cb2fc1315d26932>
- other: <https://git.kernel.org/stable/c/300415caa373a07782fcbc2f8d9429bc2dc27a47>
- other: <https://git.kernel.org/stable/c/a96a44aba556c42b432929d37d60158aca21ad4c>

## 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-2023-53857>

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