{"id":68258,"date":"2025-08-16T15:32:00","date_gmt":"2025-08-16T12:02:00","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-38517-linux-kernel-oracle-alloc_tag-semaphore-acquisition-vulnerability\/"},"modified":"2025-08-16T15:32:00","modified_gmt":"2025-08-16T12:02:00","slug":"cve-2025-38517-linux-kernel-oracle-alloc_tag-semaphore-acquisition-vulnerability","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-38517-linux-kernel-oracle-alloc_tag-semaphore-acquisition-vulnerability\/","title":{"rendered":"CVE-2025-38517 &#8211; Linux Kernel Oracle alloc_tag: Semaphore Acquisition Vulnerability"},"content":{"rendered":"<p><strong>CVE ID : <\/strong>CVE-2025-38517<br \/>\n<br \/>\n<strong>Published : <\/strong> Aug. 16, 2025, 11:15 a.m. | 45\u00a0minutes ago<br \/>\n<br \/>\n<strong>Description : <\/strong>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>lib\/alloc_tag: do not acquire non-existent lock in alloc_tag_top_users()<\/p>\n<p>alloc_tag_top_users() attempts to lock alloc_tag_cttype-&gt;mod_lock even<br \/>\nwhen the alloc_tag_cttype is not allocated because:<\/p>\n<p>  1) alloc tagging is disabled because mem profiling is disabled<br \/>\n     (!alloc_tag_cttype)<br \/>\n  2) alloc tagging is enabled, but not yet initialized (!alloc_tag_cttype)<br \/>\n  3) alloc tagging is enabled, but failed initialization<br \/>\n     (!alloc_tag_cttype or IS_ERR(alloc_tag_cttype))<\/p>\n<p>In all cases, alloc_tag_cttype is not allocated, and therefore<br \/>\nalloc_tag_top_users() should not attempt to acquire the semaphore.<\/p>\n<p>This leads to a crash on memory allocation failure by attempting to<br \/>\nacquire a non-existent semaphore:<\/p>\n<p>  Oops: general protection fault, probably for non-canonical address 0xdffffc000000001b: 0000 [#3] SMP KASAN NOPTI<br \/>\n  KASAN: null-ptr-deref in range [0x00000000000000d8-0x00000000000000df]\n  CPU: 2 UID: 0 PID: 1 Comm: systemd Tainted: G      D             6.16.0-rc2 #1 VOLUNTARY<br \/>\n  Tainted: [D]=DIE<br \/>\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04\/01\/2014<br \/>\n  RIP: 0010:down_read_trylock+0xaa\/0x3b0<br \/>\n  Code: d0 7c 08 84 d2 0f 85 a0 02 00 00 8b 0d df 31 dd 04 85 c9 75 29 48 b8 00 00 00 00 00 fc ff df 48 8d 6b 68 48 89 ea 48 c1 ea 03  3c 02 00 0f 85 88 02 00 00 48 3b 5b 68 0f 85 53 01 00 00 65 ff<br \/>\n  RSP: 0000:ffff8881002ce9b8 EFLAGS: 00010016<br \/>\n  RAX: dffffc0000000000 RBX: 0000000000000070 RCX: 0000000000000000<br \/>\n  RDX: 000000000000001b RSI: 000000000000000a RDI: 0000000000000070<br \/>\n  RBP: 00000000000000d8 R08: 0000000000000001 R09: ffffed107dde49d1<br \/>\n  R10: ffff8883eef24e8b R11: ffff8881002cec20 R12: 1ffff11020059d37<br \/>\n  R13: 00000000003fff7b R14: ffff8881002cec20 R15: dffffc0000000000<br \/>\n  FS:  00007f963f21d940(0000) GS:ffff888458ca6000(0000) knlGS:0000000000000000<br \/>\n  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br \/>\n  CR2: 00007f963f5edf71 CR3: 000000010672c000 CR4: 0000000000350ef0<br \/>\n  Call Trace:<\/p>\n<p>   codetag_trylock_module_list+0xd\/0x20<br \/>\n   alloc_tag_top_users+0x369\/0x4b0<br \/>\n   __show_mem+0x1cd\/0x6e0<br \/>\n   warn_alloc+0x2b1\/0x390<br \/>\n   __alloc_frozen_pages_noprof+0x12b9\/0x21a0<br \/>\n   alloc_pages_mpol+0x135\/0x3e0<br \/>\n   alloc_slab_page+0x82\/0xe0<br \/>\n   new_slab+0x212\/0x240<br \/>\n   ___slab_alloc+0x82a\/0xe00<\/p>\n<p>As David Wang points out, this issue became easier to trigger after commit<br \/>\n780138b12381 (&#8220;alloc_tag: check mem_profiling_support in alloc_tag_init&#8221;).<\/p>\n<p>Before the commit, the issue occurred only when it failed to allocate and<br \/>\ninitialize alloc_tag_cttype or if a memory allocation fails before<br \/>\nalloc_tag_init() is called.  After the commit, it can be easily triggered<br \/>\nwhen memory profiling is compiled but disabled at boot.<\/p>\n<p>To properly determine whether alloc_tag_init() has been called and its<br \/>\ndata structures initialized, verify that alloc_tag_cttype is a valid<br \/>\npointer before acquiring the semaphore.  If the variable is NULL or an<br \/>\nerror value, it has not been properly initialized.  In such a case, just<br \/>\nskip and do not attempt to acquire the semaphore.<\/p>\n[harry.yoo@oracle.com: v3]\n<br \/>\n<strong>Severity:<\/strong> 0.0 | NA<br \/>\n<br \/>\nVisit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-38517 Published : Aug. 16, 2025, 11:15 a.m. | 45\u00a0minutes ago Description : In the Linux kernel, the following vulnerability has been resolved: lib\/alloc_tag: do not acquire non-existent lock in alloc_tag_top_users() alloc_tag_top_users() attempts to lock alloc_tag_cttype-&gt;mod_lock even when the alloc_tag_cttype is not allocated because: 1) alloc tagging is disabled because mem profiling &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-68258","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/68258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=68258"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/68258\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=68258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=68258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=68258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}