From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org,
Johannes Zink <j.zink@pengutronix.de>,
Ariel Marcovitch <arielmarcovitch@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kconfig: fix segmentation fault in menuconfig search
Date: Mon, 24 Oct 2022 10:04:41 +0700 [thread overview]
Message-ID: <Y1YAyQ4s+wxfAPAU@debian.me> (raw)
In-Reply-To: <20221023191055.85098-1-masahiroy@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]
On Mon, Oct 24, 2022 at 04:10:55AM +0900, Masahiro Yamada wrote:
> Since commit d05377e184fc ("kconfig: Create links to main menu items
> in search"), menuconfig shows a jump key next to "Main menu" if the
> nearest visible parent is the rootmenu. If you press that jump key,
> menuconfig crashes with a segmentation fault.
>
> For example, do this:
>
> $ make ARCH=arm64 allnoconfig menuconfig
>
> Press '/' to search for the string "ACPI". Press '1' to choose
> "(1) Main menu". Then, menuconfig crashed with a segmentation fault.
You missed the prerequisites: search EFI and press 1 to jump to
CONFIG_EFI.
>
> The following code in search_conf()
>
> conf(targets[i]->parent, targets[i]);
>
> results in NULL pointer dereference because targets[i] is the rootmenu,
> which does not have a parent.
>
> Commit d05377e184fc tried to fix the issue of top-level items not having
> a jump key, but adding the "Main menu" was not the right fix.
>
> The correct fix is to show the searched item itself. This fixes another
> weird behavior described in the comment block.
>
> Fixes: d05377e184fc ("kconfig: Create links to main menu items in search")
> Reported-by: Johannes Zink <j.zink@pengutronix.de>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> Link: https://lore.kernel.org/r/20221023191055.85098-1-masahiroy@kernel.org
Missing Cc: stable? The segfault (IMO) appears after v5.15, so all
supported stable branches are affected.
Anyway, the segfault gone away with this patch applied. Thanks.
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2022-10-24 3:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 19:10 [PATCH] kconfig: fix segmentation fault in menuconfig search Masahiro Yamada
2022-10-24 3:04 ` Bagas Sanjaya [this message]
2022-10-24 4:53 ` Masahiro Yamada
2022-10-24 9:26 ` Bagas Sanjaya
2022-10-31 17:31 ` Johannes Zink
2022-11-02 8:35 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y1YAyQ4s+wxfAPAU@debian.me \
--to=bagasdotme@gmail.com \
--cc=arielmarcovitch@gmail.com \
--cc=j.zink@pengutronix.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).