mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-24 02:52:38 +00:00
This prevents segfault when getting filename and lineno in recursive
checks.
If the following snippet is found in Kconfig:
[Test code 1]
config FOO
bool
depends on BAR
select BAR
... without BAR defined; then there is a segfault.
Kconfig:34:error: recursive dependency detected!
Kconfig:34: symbol FOO depends on BAR
make[4]: *** [scripts/kconfig/Makefile:85: allnoconfig] Segmentation fault
This is because of the following. BAR is a fake entry created by
sym_lookup() with prop being NULL. In the recursive check, there is a
NULL check for prop to fall back to stack->sym->prop if stack->prop is
NULL. However, in this case, stack->sym points to the fake BAR entry
created by sym_lookup(), so prop is still NULL. prop was then referenced
without additional NULL checks, causing segfault.
As the previous email thread suggests, the file and lineno for select is
also wrong:
[Test code 2]
config FOO
bool
config BAR
bool
config FOO
bool "FOO"
depends on BAR
select BAR
$ make defconfig
*** Default configuration is based on 'x86_64_defconfig'
Kconfig:1:error: recursive dependency detected!
Kconfig:1: symbol FOO depends on BAR
Kconfig:4: symbol BAR is selected by FOO
[...]
Kconfig:4 should be Kconfig:10.
This patch deletes the wrong and segfault-prone filename/lineno
inference completely. With this patch, Test code 1 yields:
error: recursive dependency detected!
symbol FOO depends on BAR
symbol BAR is selected by FOO
Signed-off-by: HONG Yifan <elsk@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
39 lines
1.4 KiB
Plaintext
39 lines
1.4 KiB
Plaintext
error: recursive dependency detected!
|
|
symbol A depends on A
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|
|
|
|
error: recursive dependency detected!
|
|
symbol B is selected by B
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|
|
|
|
error: recursive dependency detected!
|
|
symbol C1 depends on C2
|
|
symbol C2 depends on C1
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|
|
|
|
error: recursive dependency detected!
|
|
symbol D1 depends on D2
|
|
symbol D2 is selected by D1
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|
|
|
|
error: recursive dependency detected!
|
|
symbol E1 depends on E2
|
|
symbol E2 is implied by E1
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|
|
|
|
error: recursive dependency detected!
|
|
symbol F1 default value contains F2
|
|
symbol F2 depends on F1
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|
|
|
|
error: recursive dependency detected!
|
|
symbol G depends on G
|
|
For a resolution refer to Documentation/kbuild/kconfig-language.rst
|
|
subsection "Kconfig recursive dependency limitations"
|