Linux 6.16 Introduces New Helper For Restricting Symbols To Select Kernel Modules
([Linux Kernel] 3 Hours Ago
EXPORT_SYMBOL_GPL_FOR_MODULES)
- Reference: 0001551731
- News link: https://www.phoronix.com/news/Linux-6.16-Kbuild
- Source link:
All of the kernel build system "Kbuild" updates were merged today for the nearly-over [1]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.
The example given in [2]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 [3]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.
[1] https://www.phoronix.com/search/Linux+6.16
[2] https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=for-next&id=707f853d7fa3ce323a6875487890c213e34d81a0
[3] https://lore.kernel.org/lkml/CAK7LNAQunzxOHR+vMZLf8kqxyRtLx-Z2G2VZquJmndrT9TZjiQ@mail.gmail.com/
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.
The example given in [2]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 [3]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.
[1] https://www.phoronix.com/search/Linux+6.16
[2] https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=for-next&id=707f853d7fa3ce323a6875487890c213e34d81a0
[3] https://lore.kernel.org/lkml/CAK7LNAQunzxOHR+vMZLf8kqxyRtLx-Z2G2VZquJmndrT9TZjiQ@mail.gmail.com/
phoronix