VOOZH about

URL: https://www.phoronix.com/news/Linux-6.16-Kbuild

⇱ Linux 6.16 Introduces New Helper For Restricting Symbols To Select Kernel Modules - Phoronix


👁 Phoronix

Linux 6.16 Introduces New Helper For Restricting Symbols To Select Kernel Modules

Written by Michael Larabel in Linux Kernel on 7 June 2025 at 08:39 PM EDT. 3 Comments
All of the kernel build system "Kbuild" updates were merged today for the nearly-over Linux 6.16 merge window that is expected to conclude tomorrow with the Linux 6.16-rc1 release. Notable with the Kbuild pull is the introduction of the EXPORT_SYMBOL_GPL_FOR_MODULES helper.

Added to the Linux kernel today is the new EXPORT_SYMBOL_GPL_FOR_MODULES() helper. This macro can be used to limit the exporting of kernel symbols to a given list of modules.

👁 EXPORT_SYMBOL_GPL_FOR_MODULES


The example given in the patch introducing EXPORT_SYMBOL_GPL_FOR_MODULES is:
EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm");

So now it's easy to limiting GPL symbols for allowed use by only select kernel modules. The macro puts the exported symbols into a module namespace that cannot be imported by other modules. Multiple modules can be specified with this macro using a comma separated list. The macro also supports tail-globs for selecting multiple modules like "drm_*" as another avenue.

The Kbuild pull for LInux 6.16 in addition to introducing this new macro also improves ABI handling within gendwarfksyms and brings a variety of other smaller fixes and enhancements.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.