<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 512KB</title>
    <description>The latest articles on DEV Community by 512KB (@_ec17e358d2707ae0fc88).</description>
    <link>https://dev.to/_ec17e358d2707ae0fc88</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2561439%2F11c19ef4-9426-44fb-a4cd-843ac272eb33.png</url>
      <title>DEV Community: 512KB</title>
      <link>https://dev.to/_ec17e358d2707ae0fc88</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_ec17e358d2707ae0fc88"/>
    <language>en</language>
    <item>
      <title>An Idea for Improving Linux Kernel Module Compatibility</title>
      <dc:creator>512KB</dc:creator>
      <pubDate>Fri, 16 Oct 2026 08:52:16 +0000</pubDate>
      <link>https://dev.to/_ec17e358d2707ae0fc88/an-idea-for-improving-linux-kernel-module-compatibility-29l7</link>
      <guid>https://dev.to/_ec17e358d2707ae0fc88/an-idea-for-improving-linux-kernel-module-compatibility-29l7</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Anyone who has worked on Linux kernel development probably knows that starting with Linux 5.7, &lt;code&gt;kallsyms_lookup_name()&lt;/code&gt; was no longer exported to prevent third-party modules from bypassing &lt;code&gt;EXPORT_SYMBOL&lt;/code&gt; restrictions and accessing internal kernel functions.&lt;/p&gt;

&lt;p&gt;Meanwhile, eBPF has continued to grow, but it still can't replace traditional kernel modules in every scenario, such as hardware driver development or certain security features that need to suspend kernel operations while waiting for a decision from user space.&lt;/p&gt;

&lt;p&gt;This makes me wonder: if traditional kernel modules have compatibility issues, why can't we improve their compatibility mechanisms while continuing to develop eBPF?&lt;/p&gt;

&lt;h3&gt;
  
  
  On Misuse
&lt;/h3&gt;

&lt;p&gt;Removing the export of &lt;code&gt;kallsyms_lookup_name()&lt;/code&gt; certainly makes it harder for third-party modules to access internal symbols. But those who genuinely need these symbols can still find other ways to locate them.&lt;/p&gt;

&lt;p&gt;As a result, misuse hasn't been completely prevented, while operations that could previously be done directly through an exported function now require more complicated workarounds.&lt;/p&gt;

&lt;p&gt;For example, this change in Linux 5.7 affected &lt;a href="https://lists.openwall.net/linux-kernel/2020/05/05/576" rel="noopener noreferrer"&gt;LTTng&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I understand why kernel maintainers don't want third-party drivers to depend on internal implementation details. But removing a lookup interface &lt;strong&gt;doesn't make the need for it disappear&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Of course, &lt;strong&gt;being able to find a symbol doesn't mean you should be free to call it however you like&lt;/strong&gt;. These two points aren't contradictory.&lt;/p&gt;

&lt;h3&gt;
  
  
  On Compatibility Complexity
&lt;/h3&gt;

&lt;p&gt;eBPF has certainly solved some problems, but it cannot cover every use case.&lt;/p&gt;

&lt;p&gt;For out-of-tree driver developers, even if their projects are completely open source, they still have to deal with symbol CRC mismatches, changes to structure layouts, removed interfaces, and differences between Linux distributions.&lt;/p&gt;

&lt;p&gt;Although we now have two kernel extension mechanisms with different capabilities, we still lack a general-purpose solution for cross-version compatibility of traditional out-of-tree modules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Another Approach
&lt;/h3&gt;

&lt;p&gt;If kernel maintainers don't want to guarantee long-term stability for every internal symbol, could we instead maintain just a minimal stable module loading interface and a more capable symbol lookup API?&lt;/p&gt;

&lt;p&gt;For example, when a driver looks up a symbol, the kernel could return additional metadata:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Symbol address&lt;/li&gt;
&lt;li&gt;Symbol type and ABI version information&lt;/li&gt;
&lt;li&gt;Function prototype or type hash&lt;/li&gt;
&lt;li&gt;The module that owns the symbol and its lifetime information&lt;/li&gt;
&lt;li&gt;Export status, access restrictions, and supported capabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For internal symbols that aren't exported, we could also consider more fine-grained access controls instead of simply denying access altogether.&lt;/p&gt;

&lt;p&gt;As much type information as possible could be generated automatically by build tools, while behavioral compatibility would require explicit versioning rules to reduce the maintenance burden.&lt;/p&gt;

&lt;p&gt;How to use that information would then be up to the driver developers. This way, the kernel would still not need to guarantee long-term ABI stability for the vast majority of its internal functions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cost Considerations
&lt;/h3&gt;

&lt;p&gt;Of course, this design would come with costs.&lt;/p&gt;

&lt;p&gt;The stable core interfaces would need to be maintained, and a version number alone cannot capture every change in a symbol's behavior. Defining access permissions for unexported internal symbols would also be a challenge.&lt;/p&gt;

&lt;p&gt;But these issues are at least worth discussing, rather than treating "the kernel doesn't guarantee a stable ABI" as the end of the conversation.&lt;/p&gt;

&lt;p&gt;If a core interface eventually needs a breaking change, a new version could be introduced, with a reasonable support period for the old one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://access.redhat.com/solutions/6971500" rel="noopener noreferrer"&gt;Red Hat&lt;/a&gt; and &lt;a href="https://source.android.com/docs/core/architecture/kernel/stable-kmi" rel="noopener noreferrer"&gt;Android GKI&lt;/a&gt; have already implemented stable kernel ABIs within certain limits. This shows that maintaining ABI stability is possible under the right conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If we can let the kernel evolve freely while allowing external drivers to detect and adapt to changes on their own, why not give it a try?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  PS
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Note: This article was originally written by me in Chinese. I used AI to help translate it into English, but the ideas and opinions are entirely my own.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Original Chinese version: &lt;a href="https://www.cnblogs.com/KBin/p/23327958" rel="noopener noreferrer"&gt;Linux 内核模块为什么不能自己解决兼容性问题？ &lt;br&gt;
&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
