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: <04b19b773a60d201bc1b187ba7a7c86dc237a27b.1376600922.git.yann.morin.1998@free.fr>
Date:	Thu, 15 Aug 2013 23:17:32 +0200
From:	"Yann E. MORIN" <yann.morin.1998@...e.fr>
To:	linux-kbuild@...r.kernel.org, Michal Marek <mmarek@...e.cz>
Cc:	linux-kernel@...r.kernel.org,
	"Yann E. MORIN" <yann.morin.1998@...e.fr>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Yinghai Lu <yinghai@...nel.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: [PATCH 3/4] kconfig: silence warning when parsing auto.conf when a symbol has changed type

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

When a symbol changes type from tristate to bool, and was previously set to
'm', a subsequent silentoldconfig would warn about inconsistency, such as:

    include/config/auto.conf:3014:warning: symbol value 'm' invalid for
    HOTPLUG_PCI_PCIE

Seen by Linus with the merge in aa8032b (sequence to reproduce by Michal):
    git checkout 1fe0135
    make mrproper
    make allmodconfig
    make silentoldconfig
    git checkout aa8032b
    make allmodconfig
    make silentoldconfig

Since HOTPLUG_PCI_PCIE changed from tristate to bool in aa8032b, it was
previously set to 'm' in auto.conf by the first allmodconfig+silentoldconfig,
but then was set to 'y' by the second allmodconfig. Then the second
silentoldconfig prints the warning.

The warning in this case is a spurious warning, which happens at the time
kconfig tries to detect symbols that have changed, to touch the empty
header files in include/config used for dependency-tracking by make.

Silence the warning when we read the old auto.conf file, since it is
perfectly legit that a symbol changed type since the previous call.

Thread in:
    http://marc.info/?l=linux-pci&m=137569198904000&w=2

Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@...e.fr>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Michal Marek <mmarek@...e.cz>
Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Yinghai Lu <yinghai@...nel.org>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
---
 scripts/kconfig/confdata.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index c55c227..87f7238 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -140,7 +140,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 			sym->flags |= def_flags;
 			break;
 		}
-		conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+		if (def != S_DEF_AUTO)
+			conf_warning("symbol value '%s' invalid for %s",
+				     p, sym->name);
 		return 1;
 	case S_OTHER:
 		if (*p != '"') {
@@ -161,7 +163,8 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 			memmove(p2, p2 + 1, strlen(p2));
 		}
 		if (!p2) {
-			conf_warning("invalid string found");
+			if (def != S_DEF_AUTO)
+				conf_warning("invalid string found");
 			return 1;
 		}
 		/* fall through */
@@ -172,7 +175,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 			sym->def[def].val = strdup(p);
 			sym->flags |= def_flags;
 		} else {
-			conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+			if (def != S_DEF_AUTO)
+				conf_warning("symbol value '%s' invalid for %s",
+					     p, sym->name);
 			return 1;
 		}
 		break;
-- 
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