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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0706221259500.4914@shell4.speakeasy.net>
Date:	Fri, 22 Jun 2007 13:20:41 -0700 (PDT)
From:	Trent Piepho <xyzzy@...akeasy.org>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>
cc:	Roman Zippel <zippel@...ux-m68k.org>,
	Linux and Kernel Video <video4linux-list@...hat.com>,
	linux-usb-devel@...ts.sourceforge.net,
	Toralf Förster <toralf.foerster@....de>,
	Oliver Neukum <oneukum@...e.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Jan Engelhardt <jengelh@...ux01.gwdg.de>,
	Luca Risolia <luca.risolia@...dio.unibo.it>
Subject: Re: Kconfig troubles when using menuconfig - Was: [patch]Re:
 [linux-usb-devel] linux-2.6.22-rc5-gf1518a0 build #300 failed in	zc0301_core.c

On Fri, 22 Jun 2007, Mauro Carvalho Chehab wrote:
> Hi Roman,
>
> Several instabilities on Kconfig started to happen after replacing
> Kconfig menus to use menuconfig, as this one, reported by Oliver:

This is the same problem I explained before:
http://www.linuxtv.org/pipermail/v4l-dvb-maintainer/2007-May/004121.html

What you have is tristate depends on bool depends on tristate.  The bool
between the two tristates "promotes" the first tristate from m to y.

> In this specific case, all V4L USB drivers depends on V4L_USB_DRIVERS,
> that depends, in turn, on USB. So, if USB is not selected,
> V4L_USB_DRIVERS should be unselected, unselecting zc0301.

If you set USB=n, then you can not turn on V4L_USB_DRIVERS and in turn
USB_ZC0301 can't be turned on.  That does work correctly.

The problem is that if USB=m, then because V4L_USB_DRIVERS is a bool, it is
possible to set V4L_USB_DRIVERS=y.  Now you can set USB_ZC0301=y, because
USB_ZC0301 only depends on V4L_USB_DRIVERS and that is 'y'.  So you end up
with USB=m and USB_ZC0301=y, which shouldn't be allowed.

There are two easy solutions to this that I can think of.  First,
just make the menuconfig a tristate:
diff -r dfbe7cc4e21e drivers/media/video/Kconfig
--- a/drivers/media/video/Kconfig       Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/media/video/Kconfig       Fri Jun 22 13:14:29 2007 -0700
@@ -687,7 +687,7 @@ config VIDEO_CAFE_CCIC
 #

 menuconfig V4L_USB_DRIVERS
-       bool "V4L USB devices"
+       tristate "V4L USB devices"
        depends on USB
        default y

Now the menuconfig entry will be a tristate, which seems kind of odd.  If
USB=m, then you won't be able to set V4L_USB_DRIVERS to 'y', only to 'n' or
'm', and in turn none of the USB devices can be set to 'y'.

Or another way, add the dependencies of the menuconfig to the if statement:
diff -r dfbe7cc4e21e drivers/media/video/Kconfig
--- a/drivers/media/video/Kconfig       Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/media/video/Kconfig       Fri Jun 22 13:10:43 2007 -0700
@@ -691,7 +691,7 @@ menuconfig V4L_USB_DRIVERS
        depends on USB
        default y

-if V4L_USB_DRIVERS
+if V4L_USB_DRIVERS && USB

 source "drivers/media/video/pvrusb2/Kconfig"

Now all the usb drivers will gain USB as a dependency directly and can't be
set to something higher than USB.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ