CVE-2026-139310

Not scored yetLast modified Nov 30, 2026

Description

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

bpf: Hold the socket in the sk_storage map iterator

The iterator over a sk_storage map passes the owner of an element to its program as ctx->sk, without a reference. All that it holds is the RCU read lock, which keeps the element and the storage, not the socket.

An element is unlinked by bpf_sk_storage_free(), which __sk_destruct() calls right before it frees the socket. That is no better for a socket with SOCK_RCU_FREE: the grace period comes in front of __sk_destruct(), so a reader which starts behind call_rcu() still finds the element. The program and the helpers it hands ctx->sk to, such as bpf_sk_storage_get() or bpf_sk_storage_delete(), use a socket which is being freed on another CPU. It takes nothing but reading the iterator while sockets with an element in the map are closed, by whomever.

Take a reference for the time of the program, and skip the element if there is none to be had. To look at the owner at all, do what bpf_selem_unlink_nofail() does for bpf_local_storage_map_free(): as long as the element is linked under the lock of the storage, bpf_local_storage_destroy() has not got past it, unless it has given up on the lock, and then it waits for owner_refcnt.

The last reference may now be dropped by the iterator. The end of a socket may want process context: rfcomm_sock_destruct() takes a mutex. So only drop the reference under RCU, and free a socket whose last one it was when the RCU read lock has been released, which is at the end of a bucket and of every read() at the latest.

Metrics

No CVSS score has been published yet.

Affected software

Source: the vendor's advisory (CNA). NVD analysis pending.

No affected versions have been published.

Timeline

Published
Nov 30, 2026
Last modified
Nov 30, 2026
NVD status
Received

Related CVEs from 2026

CVE-2026-139311In the Linux kernel, the following vulnerability has been resolved: bpf: Link the first element after its storage is published bpf_local_sCVE-2026-139312In the Linux kernel, the following vulnerability has been resolved: bpf: Fix NULL deref in the sk_storage map iterator bpf_sk_storage_map_CVE-2026-139313In the Linux kernel, the following vulnerability has been resolved: bpf: Clear sk_refcnt of a clone before its storage is linked sk_clone(CVE-2026-139314In the Linux kernel, the following vulnerability has been resolved: bpf: Update the SRH state if End.B6 fails late For SEG6_LOCAL_ACTION_ECVE-2026-139315In the Linux kernel, the following vulnerability has been resolved: bpf: Pull the inner header for End.DT6 in End.BPF bpf_lwt_seg6_action(CVE-2026-1393168.1In the Linux kernel, the following vulnerability has been resolved: bpf: Validate the SRH which End.DT6 uncovers in End.BPF input_action_eCVE-2026-139317In the Linux kernel, the following vulnerability has been resolved: bpf: Don't saturate owner_refcnt on the last unpin bpf_local_storage_mCVE-2026-139318In the Linux kernel, the following vulnerability has been resolved: bpf: Read the probe of a perf event under event_mutex For a perf eventCVE-2026-139319In the Linux kernel, the following vulnerability has been resolved: bpf: Don't let bpf_skb_adjust_room() use up the MSS When bpf_skb_adjusCVE-2026-139326.5Inappropriate implementation in Sharing in Google Chrome on Android prior to 150.0.7871.47 allowed a remote attacker who had compromised theCVE-2026-1393207.8In the Linux kernel, the following vulnerability has been resolved: bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit In the branch ofCVE-2026-139321In the Linux kernel, the following vulnerability has been resolved: bpf: Forbid sleeping in bpf_find_vma() callbacks A sleepable program c
CVE-2026-139310: Unscored | Vulnix