[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAT54nvwYmTy20Ep8U2kr4thn68yYWXi9R-d3Yx3iXs=Bg@mail.gmail.com>
Date: Sat, 19 Jul 2025 22:30:26 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Shankari Anand <shankari.ak0208@...il.com>
Subject: Re: [BUG linux-next] nconfig: uncleared lines of text on help screens
On Sat, Jul 19, 2025 at 5:31 PM Randy Dunlap <rdunlap@...radead.org> wrote:
>
>
> If I revert
> commit 1b92b18ec419
> Author: Shankari Anand <shankari.ak0208@...il.com>
> Date: Thu Jun 26 00:36:54 2025 +0530
> kconfig: nconf: Ensure null termination where strncpy is used
>
> this problem goes away.
>
> When using F1, F2, or F3 (Help, SymInfo, or Help 2), short lines
> of text are not cleared (blanked, space-filled).
Indeed.
This is a bug introduced by the following change:
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 4bfdf8ac2a9a..475a403ab8ba 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -177,7 +177,7 @@ void fill_window(WINDOW *win, const char *text)
const char *line = get_line(text, i);
int len = get_line_length(line);
strncpy(tmp, line, min(len, x));
- tmp[len] = '\0';
+ tmp[sizeof(tmp) - 1] = '\0';
mvwprintw(win, i, 0, "%s", tmp);
}
}
The original code already null-terminates the buffer.
This part should be reverted.
> Example F1:
>
> ┌── Global help ───────────────────────────────────────────────────────────┐
> ┌│ │┐
> ││ Help windows ││
> ││ ------------ ││
> ││ o Global help: Unless in a data entry window, pressing <F1> will give `││
> ││ you the global help window, which you are just reading.F1> will give `││
> ││ you the global help window, which you are just reading.F1> will give `││
> ││ o A short version of the global help is available by pressing <F3>.ive `││
> ││ o A short version of the global help is available by pressing <F3>.ive `││
> ││ o Local help: To get help related to the current menu entry, use anye `││
> ││ of <?> <h>, or if in a data entry window then press <F1>.y, use anye `││
> ││ of <?> <h>, or if in a data entry window then press <F1>.y, use anye `││
> ││ of <?> <h>, or if in a data entry window then press <F1>.y, use anye `││
> ││ Menu entries>, or if in a data entry window then press <F1>.y, use anye `││
> ││ ------------>, or if in a data entry window then press <F1>.y, use anye `││
> ││ This interface lets you select features and parameters for the kernelye `││
> ││ build. Kernel features can either be built-in, modularized, or removed.`││
> ││ Parameters must be entered as text or decimal or hexadecimal numbers.ed.`││
> ││ Parameters must be entered as text or decimal or hexadecimal numbers.ed.`││
> ││ Menu entries beginning with following braces represent features that.ed.`
>
>
> Example F2:
>
> ┌── Sysfs syscall support ──────────────────────────────────────────┐
> ┌── │ │────┐
> │ │ CONFIG_SYSFS_SYSCALL: │ │
> │ [*│ CONFIG_SYSFS_SYSCALL: │ │
> │ [ │ sys_sysfs is an obsolete system call no longer supported in libc. │ │
> │ [*│ Note that disabling this option is more secure but might breakbc. │ │
> │ │ compatibility with some systems.is more secure but might breakbc. │ │
> │ [ │ compatibility with some systems.is more secure but might breakbc. │ │
> │ [*│ If unsure say N here.me systems.is more secure but might breakbc. │ │
> │ < │ If unsure say N here.me systems.is more secure but might breakbc. │ │
> │ [*│ Symbol: SYSFS_SYSCALL [=n]stems.is more secure but might breakbc. │ │
> │ -*│ Type : boolS_SYSCALL [=n]stems.is more secure but might breakbc. │ │
> │ -*│ Defined at init/Kconfig:1600ems.is more secure but might breakbc. │ │
> │ [*│ Prompt: Sysfs syscall support.is more secure but might breakbc. │ │
> │ [ │ Location:ysfs syscall support.is more secure but might breakbc. │ │
> │ [*│ -> General setupall support.is more secure but might breakbc. │ │
> │ [ │ -> Sysfs syscall support (SYSFS_SYSCALL [=n])might breakbc. │ │
> │ -*│ -> Sysfs syscall support (SYSFS_SYSCALL [=n])might breakbc. │ │
> │ [ │ -> Sysfs syscall support (SYSFS_SYSCALL [=n])might breakbc.
>
>
> Example F3:
>
> ┌──┌── Short help ────────────────────────────────────────────────────────┐──┐
> │ │ │ │
> │ [│ Legend: [*] built-in [ ] excluded <M> module < > module capable. │ │
> │ [│ Submenus are designated by a trailing "--->", empty ones by "----".. │ │
> │ [│ Submenus are designated by a trailing "--->", empty ones by "----".. │ │
> │ │ Use the following keys to navigate the menus: empty ones by "----".. │ │
> │ [│ Move up or down with <Up> or <Down>.he menus: empty ones by "----".. │ │
> │ [│ Enter a submenu with <Enter> or <Right>.enus: empty ones by "----".. │ │
> │ <│ Exit a submenu to its parent menu with <Esc> or <Left>.s by "----".. │ │
> │ [│ Pressing <y> includes, <n> excludes, <m> modularizes features.---".. │ │
> │ -│ Pressing <Space> cycles through the available options.eatures.---".. │ │
> │ -│ To search for menu entries press </>.vailable options.eatures.---".. │ │
> │ [│ <Esc> always leaves the current window.ilable options.eatures.---".. │ │
> │ [│ <Esc> always leaves the current window.ilable options.eatures.---".. │ │
> │ [│ Pressing <1> may be used instead of <F1>, <2> instead of <F2>, etc.. │ │
> │ [│ For verbose global help press <F1>. <F1>, <2> instead of <F2>, etc.. │ │
> │ -│ For help related to the current menu entry press <?> or <h>.>, etc..
>
> --
> ~Randy
>
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists