Declare module metadata with MODULE_LICENSE and MODULE_AUTHOR
Set MODULE_LICENSE, MODULE_AUTHOR and MODULE_DESCRIPTION in a Linux 6.12 module, and see how the license decides which symbols you may use.
Every module should say who wrote it, what it does and under which license. The license is not decoration: the loader compares it with the kernel's GPL-only exports and taints the kernel when it does not recognize a free license.
#include <linux/module.h>
static int __init demo_init(void) { return 0; }
static void __exit demo_exit(void) { }
module_init(demo_init);
module_exit(demo_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ada Example <[email protected]>");
MODULE_DESCRIPTION("Demo module that does nothing");modinfo -F license demo.koGPLA module that declares "Proprietary" or omits the macro cannot link against symbols exported with EXPORT_SYMBOL_GPL, and loading it sets taint flag P (and G stays off), which makes bug reports from that kernel unwelcome. The accepted strings are listed in include/linux/module.h and the module documentation. Use "Dual MIT/GPL" or "Dual BSD/GPL" if the code is also offered under another license; the kernel treats those as GPL-compatible. Recent modpost versions warn about a missing MODULE_DESCRIPTION, so add it from the start.