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: <1515567374-12722-2-git-send-email-yamada.masahiro@socionext.com>
Date:   Wed, 10 Jan 2018 15:56:10 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     linux-kbuild@...r.kernel.org
Cc:     Sam Ravnborg <sam@...nborg.org>,
        Michal Marek <michal.lkml@...kovi.net>,
        Ulf Magnusson <ulfalizer@...il.com>,
        Marc Herbert <marc.herbert@...el.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 2/6] kconfig: call sym_calc_value() for all symbols before writing to .config

conf_write() skips sym_calc_value() for "choice", but we do not need
to do so.

conf_set_all_new_symbols() may have already called sym_calc_value()
for "choice", but set_all_choice_value() has cleared SYMBOL_VALID away.
So, conf_write() re-calculates "choice" here when calculating the
visibility of its children (choice value).

We can pass NULL to sym_calc_value() since it is no-op.

This should give no impact on behavior, but make the logic more easier
to understand.

Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---

 scripts/kconfig/confdata.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 027f5b4..bc83965 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -790,6 +790,8 @@ int conf_write(const char *name)
 	menu = rootmenu.list;
 	while (menu) {
 		sym = menu->sym;
+		sym_calc_value(sym);
+
 		if (!sym) {
 			if (!menu_is_visible(menu))
 				goto next;
@@ -799,7 +801,6 @@ int conf_write(const char *name)
 				     "# %s\n"
 				     "#\n", str);
 		} else if (!(sym->flags & SYMBOL_CHOICE)) {
-			sym_calc_value(sym);
 			if (!(sym->flags & SYMBOL_WRITE))
 				goto next;
 			sym->flags &= ~SYMBOL_WRITE;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ