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] [day] [month] [year] [list]
Date:   Thu, 7 Dec 2017 23:50:24 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Ulf Magnusson <ulfalizer@...il.com>
Cc:     "Yann E. MORIN" <yann.morin.1998@...e.fr>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] kconfig: Warn if choice default is not in choice

2017-10-04 8:25 GMT+09:00 Ulf Magnusson <ulfalizer@...il.com>:
> This will catch mistakes like in the following real-world example, where
> a "CONFIG_" prefix snuck in, making an undefined symbol the default:
>
>         choice
>                 prompt "Compiler optimization level"
>                 default CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
>
>         config CC_OPTIMIZE_FOR_PERFORMANCE
>                 ...
>
>         config CC_OPTIMIZE_FOR_SIZE
>                 ...
>
>         endchoice
>
> This now prints the following warning:
>
>         init/Kconfig:1036:warning: choice default symbol 'CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE' is not contained in the choice
>
> Cases where the default symbol belongs to the wrong choice are also
> detected.
>
> (The mistake is harmless here: Since the default symbol is not visible,
> the choice falls back on using the first visible symbol as the default,
> which is CC_OPTIMIZE_FOR_PERFORMANCE, as intended.)
>
> Discovered while playing around with Kconfiglib
> (https://github.com/ulfalizer/Kconfiglib).
>
> Signed-off-by: Ulf Magnusson <ulfalizer@...il.com>
> ---

Applied to linux-kbuild/kconfig.
Thanks!

-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ