lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d14745a6-fbdc-ff84-5553-18af6d922989@linux.intel.com>
Date:   Mon, 21 Sep 2020 09:50:56 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Filipe Brandenburger <filbranden@...gle.com>,
        Greg Thelen <gthelen@...gle.com>,
        Michael Davidson <md@...gle.com>,
        Eugene Surovegin <surovegin@...gle.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Michal Marek <michal.lkml@...kovi.net>,
        Jonathan Corbet <corbet@....net>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH] modpost: allow modpost to fail on warnings

Thanks for the review,

>> Set KBUILD_MODPOST_FAIL_ON_WARNINGS to a non-empty value to make the
>> kbuild fail when modpost generates any warnings. This will avoid
>> misses such as [1] where the SOF CI did not catch a missing module
>> license.
>>
>> This was initially contributed in 2016 [2], rebase/clean-ups and tests
>> by Pierre Bossart.
>>
>> Test example:
>> $ KBUILD_MODPOST_FAIL_ON_WARNINGS=1 make
>>    GEN     Makefile
>>    DESCEND  objtool
>>    CALL    sof-dev/scripts/atomic/check-atomics.sh
>>    CALL    sof-dev/scripts/checksyscalls.sh
>>    CHK     include/generated/compile.h
>>    MODPOST Module.symvers
>> Kernel: arch/x86/boot/bzImage is ready  (#13)
>> WARNING: modpost: missing MODULE_LICENSE() in sound/soc/intel/boards/snd-soc-sof-sdw.o
>> make[2]: *** [sof-dev/scripts/Makefile.modpost:114: Module.symvers] Error 2
> 
> 
> I think [1] should be an error instead of a warning
> by default.

would the following patch be what you have in mind?

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 422f1cfca289..ae1eb67aa0f2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2018,7 +2018,7 @@ static void read_symbols(const char *modname)
         if (!mod->is_vmlinux) {
                 license = get_modinfo(&info, "license");
                 if (!license)
-                       warn("missing MODULE_LICENSE() in %s\n", modname);
+                       error("missing MODULE_LICENSE() in %s\n", modname);
                 while (license) {
                         if (license_is_gpl_compatible(license))
                                 mod->gpl_compatible = 1;


If yes, also wondering if we can still add the option to treat warnings 
as errors as an opt-in behavior?

Thanks!
-Pierre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ