CVE-2023-53857: bpf: bpf_sk_storage: Fix invalid wait context lockdep report

Published Dec 9, 2025
·
Updated

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

bpf: bpfskstorage: Fix invalid wait context lockdep report

'./testprogs -t testlocalstorage' 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] testprogs/1729 is trying to lock: [ 27.140713] ffff8883ef047b88 (stocklock){-.-.}-{3:3}, at: locallockacquire+0x9/0x130 [ 27.141834] other info that might help us debug this: [ 27.142437] context-{5:5} [ 27.142856] 2 locks held by testprogs/1729: [ 27.143352] #0: ffffffff84bcd9c0 (rcureadlock){....}-{1:3}, at: rculockacquire+0x4/0x40 [ 27.144492] #1: ffff888107deb2c0 (&storage->lock){..-.}-{2:2}, at: bpflocalstorageupdate+0x39e/0x8e0 [ 27.145855] stack backtrace: [ 27.146274] CPU: 0 PID: 1729 Comm: testprogs 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] dumpstacklvl+0x130/0x1d0 [ 27.152609] dumpstack+0x14/0x20 [ 27.153131] lockacquire+0x1657/0x2220 [ 27.153677] lockacquire+0x1b8/0x510 [ 27.157908] locallockacquire+0x29/0x130 [ 27.159048] objcgroupcharge+0xf4/0x3c0 [ 27.160794] slabpreallochook+0x28e/0x2b0 [ 27.161931] kmemcacheallocnode+0x51/0x210 [ 27.163557] kmalloc+0xaa/0x210 [ 27.164593] bpfmapkzalloc+0xbc/0x170 [ 27.165147] bpfselemalloc+0x130/0x510 [ 27.166295] bpflocalstorageupdate+0x5aa/0x8e0 [ 27.167042] bpffdskstorageupdateelem+0xdb/0x1a0 [ 27.169199] bpfmapupdatevalue+0x415/0x4f0 [ 27.169871] mapupdateelem+0x413/0x550 [ 27.170330] sysbpf+0x5e9/0x640 [ 27.174065] x64sysbpf+0x80/0x90 [ 27.174568] dosyscall64+0x48/0xa0 [ 27.175201] entrySYSCALL64afterhwframe+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 ORIGRAX: 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 locallock while holding a rawspinlock. It means it should not allocate memory while holding a rawspinlock since it is not safe for RT.

rawspinlock is needed because bpflocalstorage supports tracing context. In particular for task local storage, it is easy to get a "current" task PTRTOBTFID in tracing bpf prog. However, task (and cgroup) local storage has already been moved to bpf mem allocator which can be used after rawspinlock.

The splat is for the sk storage. For sk (and inode) storage, it has not been moved to bpf mem allocator. Using rawspinlock or not, kzalloc(GFPATOMIC) could theoretically be unsafe in tracing context. However, the local storage helper requires a verifier accepted sk pointer (PTRTOBTFID), 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 rawspinlock to silent the splat. There is an existing kzalloc before the rawspinlock. 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 Software

90 affected components
Linux Linux kernel
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-edge*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-gkeop*
ubuntu/linux-gkeop-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.8*
ubuntu/linux-intel-5.13*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.8*
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-aws-6.5*
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-6.5*
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-gcp-6.5*
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-hwe-6.5*
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-lowlatency-hwe-6.5*
ubuntu/linux-nvidia-6.2*
ubuntu/linux-nvidia-6.5*
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-oem-6.5*
ubuntu/linux-oracle-6.5*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-riscv-6.5*
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-starfive-6.5*
ubuntu/linux-azure-6.11*
ubuntu/linux-gcp-6.11*
ubuntu/linux-hwe-6.11*
ubuntu/linux-lowlatency-hwe-6.11*
ubuntu/linux-nvidia-6.11*
ubuntu/linux-oem-6.11*
ubuntu/linux-oem-6.8*
ubuntu/linux-raspi-realtime*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-6.14*
ubuntu/linux-vmware*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In bpf_sk_storage, perform kzalloc before acquiring raw_spin_lock so allocation does not occur while the lock is held.

Event History

Dec 9, 2025
CVE Published
via MITRE·01:30 AM
Data Sourced
via MITRE·01:30 AM
Description
Data Sourced
via Red Hat·02:05 AM
DescriptionSeverityAffected Software
Data Sourced
via OSV·04:17 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:17 PM
Description

Frequently Asked Questions

1

What is the severity of CVE-2023-53857?

The severity of CVE-2023-53857 is classified as moderate, primarily affecting the wait context of the bpf_sk_storage feature in the Linux kernel.

2

How do I fix CVE-2023-53857?

To fix CVE-2023-53857, update your Linux kernel to the latest patched version that addresses this vulnerability.

3

What software is impacted by CVE-2023-53857?

CVE-2023-53857 impacts the Linux Kernel developed by Linus Torvalds.

4

What type of vulnerability is CVE-2023-53857?

CVE-2023-53857 is a bug within the bpf_sk_storage component of the Linux kernel, related to invalid wait context.

5

Is there a workaround for CVE-2023-53857?

There are no known workarounds for CVE-2023-53857; applying the latest updates is the recommended course of action.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203