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]
Date: Tue, 23 Jan 2024 13:54:27 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Linux-Renesas <linux-renesas-soc@...r.kernel.org>, 
	Vegard Nossum <vegard.nossum@...cle.com>
Subject: Re: [PATCH 1/2] kconfig: remove unneeded symbol_empty variable

Hi Yamada-san,

On Sat, Nov 25, 2023 at 5:36 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> This is used only for initializing other variables.
>
> Use the empty string "".
>
> Please note newval.tri is unused for S_INT/HEX/STRING.
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>

Thanks for your patch, which is now commit 4e244c10eab345a7
("kconfig: remove unneeded symbol_empty variable") in v6.8-rc1.

When running "make <foo>_defconfig" with <foo>_defconfig an SMP
defconfig without explicit configuration of CONFIG_LOG_CPU_MAX_BUF_SHIFT,
the aforementioned commit causes a change in the generated .config:

-CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
+CONFIG_LOG_CPU_MAX_BUF_SHIFT=0

It looks like CONFIG_BASE_SMALL=0 is treated as a string instead of
the integer number zero?

init/Kconfig=config LOG_CPU_MAX_BUF_SHIFT
init/Kconfig-   int "CPU kernel log buffer size contribution (13 => 8
KB, 17 => 128KB)"
init/Kconfig-   depends on SMP
init/Kconfig-   range 0 21
init/Kconfig:   default 12 if !BASE_SMALL
init/Kconfig:   default 0 if BASE_SMALL

Note that reverting 4e244c10eab345a7 is not sufficient to fix the issue.
Also reverting commit 6262afa10ef7cc8f ("kconfig: default to zero if
int/hex symbol lacks default property") does fix it.

Thanks!

> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -29,12 +29,6 @@ struct symbol symbol_no = {
>         .flags = SYMBOL_CONST|SYMBOL_VALID,
>  };
>
> -static struct symbol symbol_empty = {
> -       .name = "",
> -       .curr = { "", no },
> -       .flags = SYMBOL_VALID,
> -};
> -
>  struct symbol *modules_sym;
>  static tristate modules_val;
>
> @@ -346,7 +340,7 @@ void sym_calc_value(struct symbol *sym)
>         case S_INT:
>         case S_HEX:
>         case S_STRING:
> -               newval = symbol_empty.curr;
> +               newval.val = "";
>                 break;
>         case S_BOOLEAN:
>         case S_TRISTATE:
> @@ -697,13 +691,12 @@ const char *sym_get_string_default(struct symbol *sym)
>  {
>         struct property *prop;
>         struct symbol *ds;
> -       const char *str;
> +       const char *str = "";
>         tristate val;
>
>         sym_calc_visibility(sym);
>         sym_calc_value(modules_sym);
>         val = symbol_no.curr.tri;
> -       str = symbol_empty.curr.val;
>
>         /* If symbol has a default value look it up */
>         prop = sym_get_default_prop(sym);

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68korg

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ