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-next>] [day] [month] [year] [list]
Message-ID: <d5271606263b496c841abd62647f9db0@SOC-EX02V.e01.socionext.com>
Date:	Mon, 16 Nov 2015 10:32:51 +0000
From:	<yamada.masahiro@...ionext.com>
To:	<arnd@...db.de>
CC:	<linux-arm-kernel@...ts.infradead.org>, <arm@...nel.org>,
	<mmarek@...e.com>, <olof@...om.net>,
	<linux-kbuild@...r.kernel.org>, <jamie@...ieiles.com>,
	<agross@...eaurora.org>, <kernel@...gutronix.de>,
	<gregory.clement@...e-electrons.com>, <linux-sh@...r.kernel.org>,
	<tsahee@...apurnalabs.com>, <linux-arm-msm@...r.kernel.org>,
	<linus.walleij@...aro.org>, <galak@...eaurora.org>,
	<plagnioj@...osoft.com>, <dinguyen@...nsource.altera.com>,
	<baohua@...nel.org>, <shiraz.linux.kernel@...il.com>,
	<rjui@...adcom.com>, <patrice.chotard@...com>,
	<kernel@...inux.com>, <soren.brinkmann@...inx.com>,
	<horms@...ge.net.au>, <michal.simek@...inx.com>, <heiko@...ech.de>,
	<linux-rockchip@...ts.infradead.org>, <linux-soc@...r.kernel.org>,
	<davidb@...eaurora.org>, <sbranden@...adcom.com>,
	<vireshk@...nel.org>, <alexandre.belloni@...e-electrons.com>,
	<kyungmin.park@...sung.com>, <mappyland78@...il.com>,
	<k.kozlowski@...sung.com>, <bcm-kernel-feedback-list@...adcom.com>,
	<f.fainelli@...il.com>, <gnurou@...il.com>,
	<matthias.bgg@...il.com>, <kgene@...nel.org>,
	<thierry.reding@...il.com>, <robh@...nel.org>,
	<linux-kernel@...r.kernel.org>, <spear-devel@...t.st.com>,
	<sebastian.hesselbarth@...il.com>, <sudeep.holla@....com>,
	<andrew@...n.ch>, <linux@....linux.org.uk>,
	<linux-samsung-soc@...r.kernel.org>,
	<linux-mediatek@...ts.infradead.org>,
	<linux-tegra@...r.kernel.org>, <maxime.coquelin@...com>,
	<srinivas.kandagatla@...il.com>, <shawnguo@...nel.org>,
	<liviu.dudau@....com>, <jun.nie@...aro.org>,
	<lorenzo.pieralisi@....com>, <nicolas.ferre@...el.com>,
	<jason@...edaemon.net>, <swarren@...dotorg.org>, <khalasa@...p.pl>,
	<xuwei5@...ilicon.com>, <magnus.damm@...il.com>, <wens@...e.org>,
	<maxime.ripard@...e-electrons.com>
Subject: RE: [PATCH] ARM: use "depends on" for SoC configs instead of "if"
 after prompt

Hi Arnd,

 
> On Monday 16 November 2015 12:06:10 Masahiro Yamada wrote:
> > Many ARM sub-architectures use prompts followed by "if" conditional,
> > but it is wrong.
> >
> > Please notice the difference between
> >
> >     config ARCH_FOO
> >             bool "Foo SoCs" if ARCH_MULTI_V7
> >
> > and
> >
> >     config ARCH_FOO
> >             bool "Foo SoCs"
> >             depends on ARCH_MULTI_V7
> >
> > These two are *not* equivalent!
> >
> > In the former statement, it is not ARCH_FOO, but its prompt that
> > depends on ARCH_MULTI_V7.  So, it is completely valid that ARCH_FOO is
> > selected by another, but ARCH_MULTI_V7 is still disabled. As it is not
> > unmet dependency, Kconfig never warns.  This is probably not what you
> > want.
> 
> Did you encounter a case where someone actually did a 'select' on one of
> those symbols? I probably introduced a lot of them and did not expect that
> to happen.

No, for ARM sub-architectures.
But, yes for the ARM core part.


For example, the following entry in arch/arm/Kconfig is suspicous.

config PCI
        bool "PCI support" if MIGHT_HAVE_PCI
        help
          Find out whether you have a PCI motherboard. PCI is the name of a
          bus system, i.e. the way the CPU talks to the other stuff inside
          your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
          VESA. If you have PCI, say Y, otherwise N.




Try "make ARCH=arm footbridge_defconfig" and check the .config file.

It defines CONFIG_PCI=y, but not CONFIG_MIGHT_HAVE_PCI.
I am not sure this is a sane .config or not.

But, anyway, Kconfig does not complain about it.


We have similar issues for CPU_V6, CPU_V6K, CPU_V7, etc.
The config is selected, but the "if" conditional is unmet.
(I decided to postpone this problem because it would take some time to understand
complicated dependency.)

The use of a prompt followed by "if" without correct understanding is dangerous
because it could hide the unmet dependency problem.

I want to eliminate the potential problem by this patch
before somebody introduce insane dependency.


> 
> > diff --git a/arch/arm/mach-integrator/Kconfig
> > b/arch/arm/mach-integrator/Kconfig
> > index 02d0834..2fa9d11 100644
> > --- a/arch/arm/mach-integrator/Kconfig
> > +++ b/arch/arm/mach-integrator/Kconfig
> > @@ -1,5 +1,6 @@
> >  config ARCH_INTEGRATOR
> > -	bool "ARM Ltd. Integrator family" if (ARCH_MULTI_V4T ||
> ARCH_MULTI_V5 || ARCH_MULTI_V6)
> > +	bool "ARM Ltd. Integrator family"
> > +	depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6
> >  	select ARM_AMBA
> >  	select ARM_PATCH_PHYS_VIRT if MMU
> >  	select AUTO_ZRELADDR
> 
> There is one related change that I would like to see, and that is to convert
> all top-level 'config' statements that have sub-options into 'menuconfig'
> statements for consistency. At the moment, the platform menu has a mix of
> platform-selection and platform-specific options, and I'd like to make that
> more consistent.

I agree, but in another patch (or series)?



Best Regards
Mashairo Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ