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]
Message-ID: <CAK7LNAQu7WmgbGkMv7WUAv0WGW+6DTPAtcW+TA5XAF9cq0hYOg@mail.gmail.com>
Date: Fri, 26 Jan 2024 22:20:38 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Yoann Congal <yoann.congal@...le.fr>
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

On Thu, Jan 25, 2024 at 11:42 PM Yoann Congal <yoann.congal@...le.fr> wrote:
>
> 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.
>

OK, please go ahead.


I will restore the Kconfig original behavior for now
and send a pull-req.




-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ