]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
module: Provide EXPORT_SYMBOL_GPL_FOR_MODULES() helper
authorPeter Zijlstra <peterz@infradead.org>
Fri, 2 May 2025 14:12:09 +0000 (16:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:18 +0000 (16:03 +0200)
commitadb29b437fe58d41bd5d4a5c3d63bf1bb02f0877
treeefed048a428a09ccdb66139b9169ca2ab2a49ac0
parenta6069306f4e18b9a0bb4d778726a451ea96dbff2
module: Provide EXPORT_SYMBOL_GPL_FOR_MODULES() helper

[ Upstream commit 707f853d7fa3ce323a6875487890c213e34d81a0 ]

Helper macro to more easily limit the export of a symbol to a given
list of modules.

Eg:

  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm");

will limit the use of said function to kvm.ko, any other module trying
to use this symbol will refure to load (and get modpost build
failures).

Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Requested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: cbe4134ea4bc ("fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/core-api/symbol-namespaces.rst
include/linux/export.h