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: <928267c8-2c79-4f76-aa6e-26dc63c77e43@smile.fr>
Date: Thu, 25 Jan 2024 15:42:32 +0100
From: Yoann Congal <yoann.congal@...le.fr>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>, 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,

Le 24/01/2024 à 21:12, Masahiro Yamada a écrit :
> On Wed, Jan 24, 2024 at 5:56 PM Yoann Congal <yoann.congal@...le.fr> wrote:
>> Le 24/01/2024 à 09:09, Masahiro Yamada a écrit :
>>> On Wed, Jan 24, 2024 at 12:11 AM Yoann Congal <yoann.congal@...le.fr> wrote:
>>>> For what it is worth, CONFIG_BASE_SMALL is defined as an int but is only used as a bool :
>>>>    $ git grep BASE_SMALL
>>>>   arch/x86/include/asm/mpspec.h:#if CONFIG_BASE_SMALL == 0
>>>>   drivers/tty/vt/vc_screen.c:#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
>>>>   include/linux/threads.h:#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
>>>>   include/linux/threads.h:#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
>>>>   include/linux/udp.h:#define UDP_HTABLE_SIZE_MIN         (CONFIG_BASE_SMALL ? 128 : 256)
>>>>   include/linux/xarray.h:#define XA_CHUNK_SHIFT           (CONFIG_BASE_SMALL ? 4 : 6)
>>>>   init/Kconfig:   default 12 if !BASE_SMALL
>>>>   init/Kconfig:   default 0 if BASE_SMALL
>>>>   init/Kconfig:config BASE_SMALL
>>>>   kernel/futex/core.c:#if CONFIG_BASE_SMALL
>>>>   kernel/user.c:#define UIDHASH_BITS      (CONFIG_BASE_SMALL ? 3 : 7)
>>>>
>>>> Maybe we should change CONFIG_BASE_SMALL to the bool type?
>>
>> My first test shows that switching CONFIG_BASE_SMALL to bool type does fix the LOG_CPU_MAX_BUF_SHIFT default value.
>>
>>>> I'll poke around to see if I can understand why a int="0" is true for kconfig.
>>
>> Here's what I understood:
>> To get the default value of LOG_CPU_MAX_BUF_SHIFT, kconfig calls sym_get_default_prop(LOG_CPU_MAX_BUF_SHIFT)
>> -> expr_calc_value("BASE_SMALL" as an expr)
>> -> sym_calc_value(BASE_SMALL as a symbol) and returns sym->curr.tri
>>
>> But, if I understood correctly, sym_calc_value() does not set sym->curr.tri in case of a int type config.
> 
> Right.

Thanks :)

> The following will restore the original behavior.
> 
> 
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -349,12 +349,15 @@ void sym_calc_value(struct symbol *sym)
>         switch (sym->type) {
>         case S_INT:
>                 newval.val = "0";
> +               newval.tri = no;
>                 break;
>         case S_HEX:
>                 newval.val = "0x0";
> +               newval.tri = no;
>                 break;
>         case S_STRING:
>                 newval.val = "";
> +               newval.tri = no;
>                 break;
>         case S_BOOLEAN:
>         case S_TRISTATE:
> > 
> But, I do not think that is the right thing to do.
> 
> Presumably, turning CONFIG_BASE_SMALL is correct.

I'm working on a patch to do that.

Regards,
-- 
Yoann Congal
Smile ECS - Tech Expert

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ