CVE-2024-36938: bpf, skmsg: Fix NULL pointer dereference in sk_psock_skb_ingress_enqueue
In the Linux kernel, the following vulnerability has been resolved:
bpf, skmsg: Fix NULL pointer dereference in sk_psock_skb_ingress_enqueue
Fix NULL pointer data-races in sk_psock_skb_ingress_enqueue() which
syzbot reported [1].
[1]
BUG: KCSAN: data-race in sk_psock_drop / sk_psock_skb_ingress_enqueue
write to 0xffff88814b3278b8 of 8 bytes by task 10724 on cpu 1:
sk_psock_stop_verdict net/core/skmsg.c:1257 [inline]
sk_psock_drop+0x13e/0x1f0 net/core/skmsg.c:843
sk_psock_put include/linux/skmsg.h:459 [inline]
sock_map_close+0x1a7/0x260 net/core/sock_map.c:1648
unix_release+0x4b/0x80 net/unix/af_unix.c:1048
__sock_release net/socket.c:659 [inline]
sock_close+0x68/0x150 net/socket.c:1421
__fput+0x2c1/0x660 fs/file_table.c:422
__fput_sync+0x44/0x60 fs/file_table.c:507
__do_sys_close fs/open.c:1556 [inline]
__se_sys_close+0x101/0x1b0 fs/open.c:1541
__x64_sys_close+0x1f/0x30 fs/open.c:1541
do_syscall_64+0xd3/0x1d0
entry_SYSCALL_64_after_hwframe+0x6d/0x75
read to 0xffff88814b3278b8 of 8 bytes by task 10713 on cpu 0:
sk_psock_data_ready include/linux/skmsg.h:464 [inline]
sk_psock_skb_ingress_enqueue+0x32d/0x390 net/core/skmsg.c:555
sk_psock_skb_ingress_self+0x185/0x1e0 net/core/skmsg.c:606
sk_psock_verdict_apply net/core/skmsg.c:1008 [inline]
sk_psock_verdict_recv+0x3e4/0x4a0 net/core/skmsg.c:1202
unix_read_skb net/unix/af_unix.c:2546 [inline]
unix_stream_read_skb+0x9e/0xf0 net/unix/af_unix.c:2682
sk_psock_verdict_data_ready+0x77/0x220 net/core/skmsg.c:1223
unix_stream_sendmsg+0x527/0x860 net/unix/af_unix.c:2339
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x140/0x180 net/socket.c:745
____sys_sendmsg+0x312/0x410 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmsg+0x1e9/0x280 net/socket.c:2667
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x46/0x50 net/socket.c:2674
do_syscall_64+0xd3/0x1d0
entry_SYSCALL_64_after_hwframe+0x6d/0x75
value changed: 0xffffffff83d7feb0 -> 0x0000000000000000
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 10713 Comm: syz-executor.4 Tainted: G W 6.8.0-syzkaller-08951-gfe46a7dd189e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Prior to this, commit 4cd12c6065df ("bpf, sockmap: Fix NULL pointer
dereference in sk_psock_verdict_data_ready()") fixed one NULL pointer
similarly due to no protection of saved_data_ready. Here is another
different caller causing the same issue because of the same reason. So
we should protect it with sk_callback_lock read lock because the writer
side in the sk_psock_drop() uses "write_lock_bh(&sk->sk_callback_lock);".
To avoid errors that could happen in future, I move those two pairs of
lock into the sk_psock_data_ready(), which is suggested by John Fastabend.
Security readout for executives and security teams
Plain-English summary
CVE-2024-36938 is a Linux kernel bug in BPF sockmap/skmsg handling. A race can leave a callback pointer NULL while another path uses it, causing a NULL pointer dereference. The provided sources show a kernel fix, but no CVSS score, severity, or active exploitation evidence.
Executive priority
Treat as a kernel maintenance item until vendor advisories clarify severity. No active exploitation is shown in the provided sources, but kernel crashes on shared infrastructure can affect availability, so include it in normal patch cycles.
Technical view
The issue is a data race in sk_psock_skb_ingress_enqueue() involving saved_data_ready during sk_psock_drop(). The fix protects sk_psock_data_ready() with sk_callback_lock, matching the writer-side locking. syzbot/KCSAN reported the race on a 6.8 syzkaller kernel.
Likely exposure
Exposure is limited to Linux systems running affected kernel builds with BPF sockmap/skmsg functionality reachable. The bundle lists Linux kernel version records including 4.20, 5.10.223, 5.15.159, 6.1.91, 6.6.31, 6.8.10, and 6.9. Exact distribution package impact requires vendor mapping.
Exploitation context
The bundle contains a syzbot/KCSAN concurrency report and kernel stable fixes. It does not cite public exploitation, CISA KEV inclusion, exploit availability, privilege requirements, or impact beyond NULL pointer dereference behavior.
Researcher notes
The source evidence supports a race-condition NULL pointer dereference in net/core/skmsg.c fixed by locking around sk_psock_data_ready(). The record lacks CVSS, CWE, exploitability analysis, and distribution-specific affected package ranges, so validation should focus on kernel commit/package mapping.
Mitigation direction
Check Linux distribution advisories for CVE-2024-36938 package status.
Update kernels to vendor builds containing the referenced stable fixes.
Prioritize internet-facing or multi-tenant Linux hosts after vendor impact confirmation.
Track kernel versions separately for containers and host nodes.
Avoid inventing workarounds; follow vendor guidance if patching is delayed.
Validation and detection
Inventory running kernel versions across servers, appliances, and cloud images.
Map each kernel package to vendor advisory status for CVE-2024-36938.
Confirm fixed kernel builds are booted, not merely installed.
Review kernel logs for unusual NULL dereference crashes around skmsg or sockmap.
Document any unsupported kernels requiring upgrade or replacement.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-36938 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.