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:	Wed,  4 Sep 2013 12:59:17 +0200
From:	"Yann E. MORIN" <yann.morin.1998@...e.fr>
To:	linux-kbuild@...r.kernel.org
Cc:	Michal Marek <mmarek@...e.cz>, linux-kernel@...r.kernel.org,
	Sam Ravnborg <sam@...nborg.org>,
	"Yann E. MORIN" <yann.morin.1998@...e.fr>
Subject: [PATCH 3/3] kconfig: do not allow more than one symbol to have 'option modules'

From: "Yann E. MORIN" <yann.morin.1998@...e.fr>

Previously, it was possible to have more than one symbol with the
'option modules' attached to them, although only the last one would
in fact control tristates.

Since this does not make much sense, only allow at most one symbol to
control tristates.

Note: it is still possible to have more than one symbol that control
tristates, but indirectly:

    config MOD1
        bool "mod1"
        select MODULES
    config MOD2
        bool "mod2"
        select MODULES
    config MODULES
        bool
        option modules

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@...e.fr>
Cc: Sam Ravnborg <sam@...nborg.org>
Cc: Michal Marek <mmarek@...e.cz>
---
 Documentation/kbuild/kconfig-language.txt | 1 +
 scripts/kconfig/menu.c                    | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index c858f84..c420676 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -147,6 +147,7 @@ applicable everywhere (see syntax).
   - "modules"
     This declares the symbol to be used as the MODULES symbol, which
     enables the third modular state for all config symbols.
+    At most one symbol may have the "modules" option set.
 
   - "env"=<value>
     This imports the environment variable into Kconfig. It behaves like
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 3a9c674..c1d5320 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -199,6 +199,12 @@ void menu_add_option(int token, char *arg)
 {
 	switch (token) {
 	case T_OPT_MODULES:
+		if (modules_sym)
+			zconf_error("symbol '%s' redefines option 'modules'"
+				    " already defined by symbol '%s'",
+				    current_entry->sym->name,
+				    modules_sym->name
+				    );
 		modules_sym = current_entry->sym;
 		break;
 	case T_OPT_DEFCONFIG_LIST:
-- 
1.8.1.2

--
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