All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] modpost: detect modules without a MODULE_LICENSE
@ 2017-11-12 19:21 Randy Dunlap
  2017-11-12 19:33 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2017-11-12 19:21 UTC (permalink / raw)
  To: LKML, Linus Torvalds; +Cc: Andrew Morton, Greg Kroah-Hartman, Sam Ravnborg

From: Randy Dunlap <rdunlap@infradead.org>

Partially revert commit 2fa365682943 (kbuild: soften MODULE_LICENSE check)
so that modpost detects modules that do not have a MODULE_LICENSE.

Sam's commit also changed the fatal error to a warning, which I am
leaving as is.

This gives advance notice of when a module has no license and will taint
the kernel if the module is loaded.

This produces the following warnings on x86_64 allmodconfig:

  MODPOST 6520 modules
WARNING: modpost: missing MODULE_LICENSE() in drivers/auxdisplay/img-ascii-lcd.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/iio/accel/kxsd9-i2c.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/iio/adc/qcom-vadc-common.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/media/platform/mtk-vcodec/mtk-vcodec-common.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/media/platform/soc_camera/soc_scale_crop.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/net/phy/cortina.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/pinctrl/pxa/pinctrl-pxa2xx.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/rpmsg/qcom_glink_native.o
WARNING: modpost: missing MODULE_LICENSE() in drivers/staging/comedi/drivers/ni_atmio.o
WARNING: modpost: missing MODULE_LICENSE() in net/9p/9pnet_xen.o
WARNING: modpost: missing MODULE_LICENSE() in sound/soc/codecs/snd-soc-pcm512x-spi.o

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/mod/modpost.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-414-rc8.orig/scripts/mod/modpost.c
+++ lnx-414-rc8/scripts/mod/modpost.c
@@ -1963,7 +1963,7 @@ static void read_symbols(char *modname)
 	}
 
 	license = get_modinfo(info.modinfo, info.modinfo_len, "license");
-	if (info.modinfo && !license && !is_vmlinux(modname))
+	if (!license && !is_vmlinux(modname))
 		warn("modpost: missing MODULE_LICENSE() in %s\n"
 		     "see include/linux/module.h for "
 		     "more information\n", modname);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] modpost: detect modules without a MODULE_LICENSE
  2017-11-12 19:21 [PATCH] modpost: detect modules without a MODULE_LICENSE Randy Dunlap
@ 2017-11-12 19:33 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2017-11-12 19:33 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: LKML, Andrew Morton, Greg Kroah-Hartman, Sam Ravnborg

On Sun, Nov 12, 2017 at 11:21 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Partially revert commit 2fa365682943 (kbuild: soften MODULE_LICENSE check)
> so that modpost detects modules that do not have a MODULE_LICENSE.

I'll happily do this after I release 4.14 (I've tagged it already).
And hopefully we can get those warnings fixed asap.

               Linus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-12 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-12 19:21 [PATCH] modpost: detect modules without a MODULE_LICENSE Randy Dunlap
2017-11-12 19:33 ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.