# CVE-2026-139312: bpf: Fix NULL deref in the sk_storage map iterator

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 9% of CVEs (2026-12-01)
- Published: 2026-11-30T13:33:35.405Z
- Modified: 2026-11-30T14:18:55.397Z
- Assigned by: Linux

## Description

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

bpf: Fix NULL deref in the sk_storage map iterator

bpf_sk_storage_map_seq_find_next() hands out an element only if its
local_storage pointer is set. __bpf_sk_storage_map_seq_show() then reads
the pointer a second time and dereferences it without a test.

Since bpf_local_storage_destroy() unlinks the elements with
bpf_selem_unlink_nofail(), the pointer is reset to NULL when the socket
which owns the element is destroyed, so it can change between the two
reads. Reading the iterator while sockets with an element in the map are
closed ends in a NULL pointer dereference. The sockets need not belong to
the reader: where a program gives every new socket an element, an
unprivileged user who opens and closes sockets is enough.

Skip such an element, as the TCP and UDP iterators skip a socket which
has been unhashed.

(As written by CVE List.)

## Affected

- Linux Linux: from 0be08389c7f2f9db0194ee666d2e4870886e6ffb before cf71608b8ac11bca93da9f961d88c27c5f07d918; from 0be08389c7f2f9db0194ee666d2e4870886e6ffb before 6186c9711ac6fb984f6c2093c52bf4e827cc50b1; 7.0 (not affected: before 7.0; from 7.3.6 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/cf71608b8ac11bca93da9f961d88c27c5f07d918>
- <https://git.kernel.org/stable/c/6186c9711ac6fb984f6c2093c52bf4e827cc50b1>

## Sources

- CVE List: [CVE-2026-139312](https://www.cve.org/CVERecord?id=CVE-2026-139312), CVE Terms of Use, modified 2026-11-30
- NVD: [CVE-2026-139312](https://nvd.nist.gov/vuln/detail/CVE-2026-139312), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-139312 · Whole record: https://cve.day/CVE-2026-139312.json · Rebuilt by cve.day 2026-11-30T14:32:58.373Z
