{"id":72002,"date":"2025-10-20T19:45:37","date_gmt":"2025-10-20T16:15:37","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-40009-fs-proc-task_mmu-check-p-vec_buf-for-null\/"},"modified":"2025-10-20T19:45:37","modified_gmt":"2025-10-20T16:15:37","slug":"cve-2025-40009-fs-proc-task_mmu-check-p-vec_buf-for-null","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-40009-fs-proc-task_mmu-check-p-vec_buf-for-null\/","title":{"rendered":"CVE-2025-40009 &#8211; fs\/proc\/task_mmu: check p-&gt;vec_buf for NULL"},"content":{"rendered":"<p>CVE ID : CVE-2025-40009<\/p>\n<p>Published :  Oct. 20, 2025, 4:15 p.m. | 26\u00a0minutes ago<\/p>\n<p>Description : In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>fs\/proc\/task_mmu: check p-&gt;vec_buf for NULL<\/p>\n<p>When the PAGEMAP_SCAN ioctl is invoked with vec_len = 0 reaches<br \/>\npagemap_scan_backout_range(), kernel panics with null-ptr-deref:<\/p>\n[   44.936808] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN NOPTI<br \/>\n[   44.937797] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]\n[   44.938391] CPU: 1 UID: 0 PID: 2480 Comm: reproducer Not tainted 6.17.0-rc6 #22 PREEMPT(none)<br \/>\n[   44.939062] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04\/01\/2014<br \/>\n[   44.939935] RIP: 0010:pagemap_scan_thp_entry.isra.0+0x741\/0xa80<\/p>\n[   44.946828] Call Trace:<br \/>\n[   44.947030]\n[   44.949219]  pagemap_scan_pmd_entry+0xec\/0xfa0<br \/>\n[   44.952593]  walk_pmd_range.isra.0+0x302\/0x910<br \/>\n[   44.954069]  walk_pud_range.isra.0+0x419\/0x790<br \/>\n[   44.954427]  walk_p4d_range+0x41e\/0x620<br \/>\n[   44.954743]  walk_pgd_range+0x31e\/0x630<br \/>\n[   44.955057]  __walk_page_range+0x160\/0x670<br \/>\n[   44.956883]  walk_page_range_mm+0x408\/0x980<br \/>\n[   44.958677]  walk_page_range+0x66\/0x90<br \/>\n[   44.958984]  do_pagemap_scan+0x28d\/0x9c0<br \/>\n[   44.961833]  do_pagemap_cmd+0x59\/0x80<br \/>\n[   44.962484]  __x64_sys_ioctl+0x18d\/0x210<br \/>\n[   44.962804]  do_syscall_64+0x5b\/0x290<br \/>\n[   44.963111]  entry_SYSCALL_64_after_hwframe+0x76\/0x7e<\/p>\n<p>vec_len = 0 in pagemap_scan_init_bounce_buffer() means no buffers are<br \/>\nallocated and p-&gt;vec_buf remains set to NULL.<\/p>\n<p>This breaks an assumption made later in pagemap_scan_backout_range(), that<br \/>\npage_region is always allocated for p-&gt;vec_buf_index.<\/p>\n<p>Fix it by explicitly checking p-&gt;vec_buf for NULL before dereferencing.<\/p>\n<p>Other sites that might run into same deref-issue are already (directly or<br \/>\ntransitively) protected by checking p-&gt;vec_buf.<\/p>\n<p>Note:<br \/>\nFrom PAGEMAP_SCAN man page, it seems vec_len = 0 is valid when no output<br \/>\nis requested and it&#8217;s only the side effects caller is interested in,<br \/>\nhence it passes check in pagemap_scan_get_args().<\/p>\n<p>This issue was found by syzkaller.<\/p>\n<p>Severity: 0.0 | NA<\/p>\n<p>Visit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-40009 Published : Oct. 20, 2025, 4:15 p.m. | 26\u00a0minutes ago Description : In the Linux kernel, the following vulnerability has been resolved: fs\/proc\/task_mmu: check p-&gt;vec_buf for NULL When the PAGEMAP_SCAN ioctl is invoked with vec_len = 0 reaches pagemap_scan_backout_range(), kernel panics with null-ptr-deref: [ 44.936808] Oops: general protection fault, probably for &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-72002","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/72002","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=72002"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/72002\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=72002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=72002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=72002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}