Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2025-38154— bpf, sockmap: Avoid using sk_socket after free when sending

CVSS 7.8 · High EPSS 0.16% · P5

Possible ATT&CK Techniques 1AI

T1203 · Exploitation for Client Execution

Affected Version Matrix 19

VendorProductVersion RangeStatus
LinuxLinux4959ffc65a0e94f8acaac20deac49f89e6ded52d< 4edb40b05cb6a261775abfd8046804ca139a5546affected
5eabdf17fed2ad41b836bb4055ec36d95e512c50< b19cbf0b9a91f5a0d93fbcd761ff71c48ab40ed9affected
e946428439a0d2079959f5603256ac51b6047017< 4c6fa65ab2aec7df94809478c8d28ef38676a1b7affected
4b4647add7d3c8530493f7247d11e257ee425bf0< 15c0250dae3b48a398447d2b364603821ed4ed90affected
4b4647add7d3c8530493f7247d11e257ee425bf0< 7c0a16f6ea2b1c82a03bccd5d1bdb4a7bbd4d987affected
4b4647add7d3c8530493f7247d11e257ee425bf0< 8259eb0e06d8f64c700f5fbdb28a5c18e10de291affected
3627605de498639a3c586c8684d12c89cba11073affected
5.15.162< 5.15.186affected
… +11 more rows
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2025-38154

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
bpf, sockmap: Avoid using sk_socket after free when sending
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Avoid using sk_socket after free when sending The sk->sk_socket is not locked or referenced in backlog thread, and during the call to skb_send_sock(), there is a race condition with the release of sk_socket. All types of sockets(tcp/udp/unix/vsock) will be affected. Race conditions: ''' CPU0 CPU1 backlog::skb_send_sock sendmsg_unlocked sock_sendmsg sock_sendmsg_nosec close(fd): ... ops->release() -> sock_map_close() sk_socket->ops = NULL free(socket) sock->ops->sendmsg ^ panic here ''' The ref of psock become 0 after sock_map_close() executed. ''' void sock_map_close() { ... if (likely(psock)) { ... // !! here we remove psock and the ref of psock become 0 sock_map_remove_links(sk, psock) psock = sk_psock_get(sk); if (unlikely(!psock)) goto no_psock; <=== Control jumps here via goto ... cancel_delayed_work_sync(&psock->work); <=== not executed sk_psock_put(sk, psock); ... } ''' Based on the fact that we already wait for the workqueue to finish in sock_map_close() if psock is held, we simply increase the psock reference count to avoid race conditions. With this patch, if the backlog thread is running, sock_map_close() will wait for the backlog thread to complete and cancel all pending work. If no backlog running, any pending work that hasn't started by then will fail when invoked by sk_psock_get(), as the psock reference count have been zeroed, and sk_psock_drop() will cancel all jobs via cancel_delayed_work_sync(). In summary, we require synchronization to coordinate the backlog thread and close() thread. The panic I catched: ''' Workqueue: events sk_psock_backlog RIP: 0010:sock_sendmsg+0x21d/0x440 RAX: 0000000000000000 RBX: ffffc9000521fad8 RCX: 0000000000000001 ... Call Trace: <TASK> ? die_addr+0x40/0xa0 ? exc_general_protection+0x14c/0x230 ? asm_exc_general_protection+0x26/0x30 ? sock_sendmsg+0x21d/0x440 ? sock_sendmsg+0x3e0/0x440 ? __pfx_sock_sendmsg+0x10/0x10 __skb_send_sock+0x543/0xb70 sk_psock_backlog+0x247/0xb80 ... '''
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于释放后重用,可能导致空指针取消引用。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
LinuxLinux 4959ffc65a0e94f8acaac20deac49f89e6ded52d ~ 4edb40b05cb6a261775abfd8046804ca139a5546 -
LinuxLinux 6.10 -

II. Public POCs for CVE-2025-38154

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2025-38154

登录查看更多情报信息。

Same Patch Batch · Linux · 2025-07-03 · 78 CVEs total

CVE-2025-381399.8 CRITICALnetfs: Fix oops in write-retry from mis-resetting the subreq iterator
CVE-2025-381239.8 CRITICALnet: wwan: t7xx: Fix napi rx poll issue
CVE-2025-381469.4 CRITICALnet: openvswitch: Fix the dead loop of MPLS parse
CVE-2025-381209.4 CRITICALnetfilter: nf_set_pipapo_avx2: fix initial map fill
CVE-2025-381117.8 HIGHnet/mdiobus: Fix potential out-of-bounds read/write access
CVE-2025-381167.8 HIGHwifi: ath12k: fix uaf in ath12k_core_init()
CVE-2025-381087.8 HIGHnet_sched: red: fix a race in __red_change()
CVE-2025-381027.8 HIGHVMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify
CVE-2025-381017.8 HIGHring-buffer: Fix buffer locking in ring_buffer_subbuf_order_set()
CVE-2025-380987.8 HIGHdrm/amd/display: Don't treat wb connector as physical in create_validate_stream_for_sink
CVE-2025-380977.8 HIGHespintcp: remove encap socket caching to avoid reference leak
CVE-2025-380957.8 HIGHdma-buf: insert memory barrier before updating num_fences
CVE-2025-381067.8 HIGHio_uring: fix use-after-free of sq->thread in __io_uring_show_fdinfo()
CVE-2025-381157.8 HIGHnet_sched: sch_sfq: fix a potential crash on gso_skb handling
CVE-2025-381177.8 HIGHBluetooth: MGMT: Protect mgmt_pending list with its own lock
CVE-2025-381187.8 HIGHBluetooth: MGMT: Fix UAF on mgmt_remove_adv_monitor_complete
CVE-2025-381277.8 HIGHice: fix Tx scheduler error handling in XDP callback
CVE-2025-381297.8 HIGHpage_pool: Fix use-after-free in page_pool_recycle_in_ring
CVE-2025-381337.8 HIGHiio: adc: ad4851: fix ad4858 chan pointer handling
CVE-2025-381417.8 HIGHdm: fix dm_blk_report_zones

Showing top 20 of 78 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2025-38154

No comments yet


Leave a comment