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: <CAK7LNAR-VXwHFEJqCcrFDZj+_4+Xd6oynbj_0eS8N504_ydmyw@mail.gmail.com>
Date:   Sun, 5 Dec 2021 02:54:05 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Salvatore Bonaccorso <carnil@...ian.org>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Michal Marek <michal.lkml@...kovi.net>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Makefile: CC_IMPLICIT_FALLTHROUGH passed quoted as argument to gcc

On Sun, Dec 5, 2021 at 1:53 AM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Sat, Dec 4, 2021 at 5:13 AM Salvatore Bonaccorso <carnil@...ian.org> wrote:
> >
> > Andreas suggested to replace the
> >
> > KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
> >
> > with
> >
> > KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(patsubst "%",%,$(CONFIG_CC_IMPLICIT_FALLTHROUGH))
>
> Ugh. I think the external build environment is a bit broken, but
> whatever. The above is ugly but I guess it works.
>
> Another alternative would be to make the Kconfig strings simply not
> have '"' as part of them.
>
> When you do
>
>     a = "hello"
>     print $a
>
> in any normal language, you generally wouldn't expect it to print the
> quotes, it should just print the bare word.
>
> But that's what the Kconfig string language basically does in this
> case. And I guess several users expect and take advantage of that ;(
>
> Masahiro? Comments?

Yes, you get to the point.

In fact, this is in my TODO list for a while
(and this is the reason I was doing prerequisite Kconfig refactoring
in the previous development cycle).
I will try to find some spare time to complete this work.



Kconfig generates two similar files,

 -   .config
 -   include/config/auto.conf

Changing the format of the .config is presumably problematic
since it is the saved user configuration as well.

It is possible (and more reasonable) to change include/config/auto.conf
so strings are not quoted.

In Makefiles, quotations are just normal characters; they have no
special functionality.

So, in Makefile context, it is more handy to do

     CONFIG_X=foo bar

instead of

    CONFIG_X="foo bar"



One problem is include/config/auto.conf is included not only by Makefiles
but also by shell scripts.


In shell context, the right hand side must be quoted
in case the value contains spaces.

   CONFIG_X="foo bar"



My plan is to fix
  scripts/link-vmlinux.sh
  scripts/gen_autoksyms.sh
etc. to not directly include the auto.conf.
Later, change Kconfig to generate the auto.conf without "".



In the meantime,

KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(patsubst
"%",%,$(CONFIG_CC_IMPLICIT_FALLTHROUGH))

 or if you prefer slightly shorter form,

KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH:"%"=%)

will be a workaround.





>
>              Linus



-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ