Querying the Module License

Technically insignificant but important from a legal point of view — the module license can now be read from the .modinfo section and placed in the module data structure:

16This is not quite correct because the kernel also defines a specific order for the various sections on the basis of their flags. However, I need not discuss this here.

kernel/module.c set_license(mod, get_modinfo(sechdrs, infoindex, "license"));

set_license checks whether the license used is GPL-compatible (by comparing its name with the string in section 7.3.3):

kernel/module.c static void set_license(struct module *mod, const char *license) {

license = "unspecified";

if (!license_is_gpl_compatible(license)) {

if (¡(tainted & TAINT_PROPRIETARY_MODULE))

printk(KERN_WARNING "%s: module license '%s' taints " "kernel.\n", mod->name, license); add_taint_module(mod, TAINT_PROPRIETARY_MODULE);

If the license found is not GPL-compatible, the taint_proprietary_module flag is set in the tainted global variable via add_taint_module, which also taints the module via the taints field in struct module. license_is_gpl_compatible determines which licenses are considered to be GPL-compatible at the moment:

kernel/module.c static inline int license_is_gpl_compatible(const char *license) {

| strcmp(license, "GPL and additional rights") == 0 | strcmp(license, "Dual BSD/GPL") == 0 | strcmp(license, "Dual MIT/GPL") == 0 | strcmp(license, "Dual MPL/GPL") == 0);

In an additional step, the kernel is also tainted if the module ndiswrapper or driverwrapper is loaded into the kernel. Although these modules would comply with the kernel by their own license, their purpose is to load binary data into the kernel (Windows drivers for wireless networking cards in the case of ndiswrapper). This is incompatible with the kernel's license and must thus require tainting.

Continue reading here: Resolving References and Relocation

Was this article helpful?

0 0