linux-stable/scripts
Masahiro Yamada 7a263a0402 kconfig: fix segmentation fault in menuconfig search
Since commit d05377e184 ("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.

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 d05377e184 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: d05377e184 ("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>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Tested-by: Johannes Zink <j.zink@pengutronix.de>
2022-11-02 17:32:05 +09:00
..
atomic
basic
clang-tools scripts/clang-tools: Convert clang-tidy args to list 2022-10-14 22:32:52 +09:00
coccinelle
dtc
dummy-tools
gcc-plugins
gdb
genksyms
kconfig kconfig: fix segmentation fault in menuconfig search 2022-11-02 17:32:05 +09:00
ksymoops
mod
package kbuild: Stop including vmlinux.bz2 in the rpm's 2022-10-13 02:10:05 +09:00
selinux
tracing
.gitignore
Kbuild.include
Kconfig.include
Lindent
Makefile
Makefile.asm-generic
Makefile.build kbuild: add -fno-discard-value-names to cmd_cc_ll_c 2022-10-15 05:22:29 +09:00
Makefile.clang
Makefile.clean
Makefile.compiler
Makefile.debug
Makefile.dtbinst
Makefile.extrawarn Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.kmsan kmsan: add KMSAN runtime core 2022-10-03 14:03:19 -07:00
Makefile.lib - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
Makefile.modfinal Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Makefile.modinst
Makefile.modpost kbuild: fix typo in modpost 2022-10-28 00:19:40 +09:00
Makefile.package
Makefile.randstruct
Makefile.ubsan
Makefile.userprogs
Makefile.vmlinux kbuild: rebuild .vmlinux.export.o when its prerequisite is updated 2022-10-03 03:52:58 +09:00
Makefile.vmlinux_o kbuild: move modules.builtin(.modinfo) rules to Makefile.vmlinux_o 2022-10-03 03:52:58 +09:00
adjust_autoksyms.sh
as-version.sh
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_doc.py
cc-can-link.sh
cc-version.sh
check-local-export
check-sysctl-docs
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
dev-needs.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen-randstruct-seed.sh
gen_autoksyms.sh
gen_ksymdeps.sh
generate_initcall_order.pl
generate_rust_analyzer.py
generate_rust_target.rs
get_abi.pl
get_dvb_firmware
get_feat.pl
get_maintainer.pl
gfp-translate
head-object-list.txt Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
headerdep.pl
headers_install.sh
insert-sys-cert.c
install.sh
is_rust_module.sh
jobserver-exec
kallsyms.c Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
kernel-doc
ld-version.sh
leaking_addresses.pl
link-vmlinux.sh kbuild: rebuild .vmlinux.export.o when its prerequisite is updated 2022-10-03 03:52:58 +09:00
makelst
markup_oops.pl
min-tool-version.sh
mkcompile_h
mksysmap kallsyms: ignore __kstrtab_* and __kstrtabns_* symbols 2022-10-03 03:51:58 +09:00
mkuboot.sh
module.lds.S
modules-check.sh
nsdeps
objdiff
objdump-func
pahole-flags.sh
pahole-version.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl
remove-stale-files
rust_is_available.sh
rust_is_available_bindgen_libclang.h
setlocalversion
show_delta
sign-file.c
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spdxexclude
spelling.txt
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh
test_fortify.sh
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh