{"id":170661,"date":"2025-05-29T22:51:16","date_gmt":"2025-05-29T22:51:16","guid":{"rendered":"https:\/\/linuxiac.com\/?p=170661"},"modified":"2025-05-29T23:02:27","modified_gmt":"2025-05-29T23:02:27","slug":"chatgpt-o3-model-found-remote-zeroday-in-linux-kernel-code","status":"publish","type":"post","link":"https:\/\/linuxiac.com\/chatgpt-o3-model-found-remote-zeroday-in-linux-kernel-code\/","title":{"rendered":"ChatGPT&#8217;s o3 Model Found Remote Zeroday in Linux Kernel Code"},"content":{"rendered":"\n<p>AI has, without a doubt, become the hottest tech topic in recent years. Some folks are excited about its endless possibilities, while others worry it\u2019s pushing us dangerously close to a sci-fi-style doomsday. But one thing&#8217;s clear\u2014AI is here and getting smarter every day.<\/p>\n\n\n\n<p>Its uses are practically limitless. It can help you whip up a 5-minute omelette\u2014or, get this\u2014it can scan massive amounts of source code and spot vulnerabilities. Yep, even in something as complex as the Linux kernel. So, what\u2019s going on here? Let\u2019s break it down.<\/p>\n\n\n\n<p>On May 22, 2025, security researcher Sean Heelan shared a compelling account of how ChatGPT\u2019s latest language model, o3, <strong>uncovered a critical remote zeroday vulnerability in the Linux kernel\u2019s SMB implementation<\/strong>, designated as <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-37899\" target=\"_blank\" rel=\"noreferrer noopener\">CVE-2025-37899<\/a>.<\/p>\n\n\n\n<p>Heelan\u2019s investigation centered on <em>ksmbd<\/em>, the Linux kernel server responsible for implementing the SMB3 protocol in kernel space for network file sharing.<\/p>\n\n\n\n<p>Initially embarking on a manual audit of <em>ksmbd<\/em> to benchmark o3\u2019s potential, Heelan quickly realized that the model was able to autonomously identify a complex use-after-free vulnerability in the handler for the SMB \u2018logoff\u2019 command\u2014an issue Heelan himself had not previously detected.<\/p>\n\n\n\n<p>What makes this finding particularly remarkable is the vulnerability\u2019s nature, which involves concurrency and shared objects accessed across multiple threads.<\/p>\n\n\n\n<p>The vulnerability occurs because one thread frees an object while another thread may still access it without proper synchronization, leading to use-after-free conditions that could allow kernel memory corruption and arbitrary code execution.<\/p>\n\n\n\n<p>Before this breakthrough, Heelan used another vulnerability, <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-37778\" target=\"_blank\" rel=\"noreferrer noopener\">CVE-2025-37778<\/a>, as a benchmark. This earlier flaw, known as the \u201cKerberos authentication vulnerability,\u201d is also a use-after-free bug triggered during Kerberos authentication in session setup requests.<\/p>\n\n\n\n<p>While this vulnerability is remote and impactful, it is relatively contained, requiring the analysis of about 3,300 lines of kernel code. Heelan\u2019s method involved feeding o3 with code from specific SMB command handlers and related functions\u2014carefully curated to remain within the model\u2019s token limits.<\/p>\n\n\n\n<p>The results were telling: across multiple runs, o3 identified the Kerberos authentication vulnerability significantly more often than previous models like Claude Sonnet 3.7, doubling or tripling detection rates. More impressively, OpenAI&#8217;s o3 produced bug reports that read more like those from human experts\u2014concise, focused, and easier to follow, although sometimes at the expense of detail.<\/p>\n\n\n\n<p>Pushing further, Heelan expanded the scope by providing o3 with a larger codebase encompassing all SMB command handlers\u2014amounting to roughly 12,000 lines of code.<\/p>\n\n\n\n<p>Despite a natural drop in performance due to scale, o3 still managed to pinpoint the Kerberos vulnerability. More intriguingly, it uncovered a previously unknown vulnerability: the very use-after-free bug in the session logoff handler that later became CVE-2025-37899.<\/p>\n\n\n\n<p>This new vulnerability exploits a race condition between threads accessing the <code>sess->user<\/code> structure. When one thread processes a LOGOFF command and frees this structure without adequate synchronization, other threads may still dereference the freed pointer, causing memory corruption or denial of service.<\/p>\n\n\n\n<p>Heelan\u2019s analysis revealed that merely setting the pointer to NULL after freeing it was insufficient to prevent this bug due to SMB protocol features allowing multiple connections to bind to the same session.<\/p>\n\n\n\n<p>Of course, he immediately reported the vulnerability. Upstream response was really fast, and the <a href=\"https:\/\/github.com\/torvalds\/linux\/commit\/2fc9feff45d92a92cd5f96487655d5be23fb7e2b\" target=\"_blank\" rel=\"noreferrer noopener\">patches merged<\/a> for every still-maintained kernel branch.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch.jpg\"><img decoding=\"async\" width=\"1024\" height=\"581\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch-1024x581.jpg\" alt=\"A remote 0-day in the Linux kernel's SMB code is already patched.\" class=\"wp-image-170682\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch-1024x581.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch-380x216.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch-768x436.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch-1536x871.jpg 1536w, https:\/\/linuxiac.com\/wp-content\/uploads\/2025\/05\/chatgpt-found-kernel-vulnerability-patch.jpg 1564w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A remote 0-day in the Linux kernel&#8217;s SMB code is already patched.<\/figcaption><\/figure>\n\n\n\n<p>So, the vulnerability is resolved in the kernel source; now it\u2019s just a matter of pulling the update from your distro. But the focus of the topic is different, as you guessed.<\/p>\n\n\n\n<p>Without claiming to be 100% correct, this might be the first confirmed real-world case where AI helped uncover and fix a flaw in the Linux kernel\u2014a true precedent, no matter how you look at it. An example of synergy between human insight and machine intelligence.<\/p>\n\n\n\n<p>And honestly, this could soon become the norm with the way things are going. Which, in my view, is totally fine\u2014and even expected.<\/p>\n\n\n\n<p>Of course, AI is not flawless and can still produce errors (for now). However, there\u2019s no denying its incredible ability to carry out complex logical operations and reason through outcomes in ways that go far beyond what any one person could do.<\/p>\n\n\n\n<p>That alone gives us good reason to believe we\u2019re standing at the edge of a new era\u2014one that could mark the next big leap in human technological evolution. And honestly, I don\u2019t think we\u2019ll have to wait long to see if that\u2019s true.<\/p>\n\n\n\n<p>Until then, if you&#8217;re curious and want to dive deeper into the technical side of this specific case, be sure to <a href=\"https:\/\/sean.heelan.io\/2025\/05\/22\/how-i-used-o3-to-find-cve-2025-37899-a-remote-zeroday-vulnerability-in-the-linux-kernels-smb-implementation\/\" target=\"_blank\" rel=\"noreferrer noopener\">check out Heelan&#8217;s blog post<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenAI&#8217;s o3 just uncovered a remote 0-day in the Linux kernel&#8217;s SMB code\u2014CVE-2025-37899. A patch has already been rolled out.<\/p>\n","protected":false},"author":10,"featured_media":170664,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,5],"tags":[5804,40,3374],"class_list":["post-170661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-news","tag-ai","tag-kernel","tag-security"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/170661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/comments?post=170661"}],"version-history":[{"count":0,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/170661\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media\/170664"}],"wp:attachment":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media?parent=170661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/categories?post=170661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/tags?post=170661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}