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]
Date:   Thu, 14 Apr 2022 19:51:46 +0200
From:   Nicolas Schier <nicolas@...sle.eu>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Randy Dunlap <rdunlap@...radead.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Yann Droneaud <ydroneaud@...eya.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCHv1] kbuild: support W=e to make build abort in case of
 warning

On Fri, Apr 15, 2022 at 12:15:40AM +0900 Masahiro Yamada wrote:
> On Thu, Apr 14, 2022 at 10:19 PM Nicolas Schier <nicolas@...sle.eu> wrote:
> >
> > På lø. 09. april 2022 kl. 10.47 +0000 skrev Masahiro Yamada:
> > > On Sat, Apr 9, 2022 at 5:36 AM Randy Dunlap <rdunlap@...radead.org> Wrote:
> > > >
> > > >
> > > >
> > > > On 4/8/22 13:29, Nick Desaulniers wrote:
> > > > > On Fri, Apr 8, 2022 at 4:06 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
> > > > >>
> > > > >> On Fri, Apr 8, 2022 at 5:46 PM Yann Droneaud <ydroneaud@...eya.com> wrote:
> > > > >>>
> > > > >>> When developing new code/feature, CONFIG_WERROR is most
> > > > >>> often turned off, especially for people using make W=12 to
> > > > >>> get more warnings.
> > > > >>>
> > > > >>> In such case, turning on -Werror temporarily would require
> > > > >>> switching on CONFIG_WERROR in the configuration, building,
> > > > >>> then switching off CONFIG_WERROR.
> > > > >>>
> > > > >>> For this use case, this patch introduces a new 'e' modifier
> > > > >>> to W= as a short hand for KCFLAGS+=-Werror" so that -Werror
> > > > >>> got added to the kernel (built-in) and modules' CFLAGS.
> > > > >>>
> > > > >>> Signed-off-by: Yann Droneaud <ydroneaud@...eya.com>
> > > > >>> ---
> > > > >>>  Makefile                   |  1 +
> > > > >>>  scripts/Makefile.extrawarn | 13 +++++++++++--
> > > > >>>  2 files changed, 12 insertions(+), 2 deletions(-)
> > > > >>>
> > > > >>> Changes since v0[0]:
> > > > >>>
> > > > >>>  - rebase on top of commit 64a91907c896 ("kbuild: refactor scripts/Makefile.extrawarn")
> > > > >>>  - document use case after commit 3fe617ccafd6 ("Enable '-Werror' by default for all kernel builds")
> > > > >>>
> > > > >>> [0] https://lore.kernel.org/all/1422803720-14723-1-git-send-email-ydroneaud@opteya.com/
> > > > >>
> > > > >>
> > > > >> I remembered the previous submission, I liked it, but I had lost it.
> > > > >>
> > > > >> It seems already 7 years ago, (before I became the Kbuild maintainer).
> > > > >> Thanks for coming back to this.
> > > > >>
> > > > >>
> > > > >> I like this, but I will wait some time for review comments.
> > > > >
> > > > > Dunno, this seems pretty simple:
> > > > >
> > > > > $ ./scripts/config -e WERROR
> > > > > $ make ... W=12
> > > >
> > > > Yeah, that's about what I was thinking too..
> > >
> > >
> > >
> > > But, you cannot change the .config
> > > when you build external modules.
> > >
> > > "make W=e" might be useful for people who strive to
> > > keep their downstream modules warning-free.
> > >
> > >
> > > W=e is the same pattern.
> > > I do not see much downside.
> >
> > If I set CONFIG_WERROR=y on the make command line, I could have the
> > same result, don't I?
> >
> >   make CONFIG_WERROR=1 ...
> >
> > no matter if in-tree or for external kernel modules.
> 
> Yes.
> 
> If you can change the kernel configuration,
> you can enable CONFIG_WERROR.
> 
> To build external modules against the read-only
> /lib/modules/$(uname -r)/build/,
> it is not so feasible to change the .config file, though.

hm, I wanted to point out something different.  When I build an external module
against a read-only kbuild-tree, I _can_ change kconfig values by specifying
them on the make command line, just as I can add 'W=e':

  make -C /lib/modules/$(uname -r)/build M=~+ CONFIG_SAMPLE_KOBJECT=m CONFIG_WERROR=y

Thus, I suspect, that this is the very same as if I'd run

  make -C /lib/modules/$(uname -r)/build M=~+ CONFIG_SAMPLE_KOBJECT=m W=e

So, "W=e" is actually just a shortcut for "CONFIG_WERROR=1".  Or have I missed
something?

Kind regards,
Nicolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ