-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/kernel/mem_protect/stackprot : input string is long stack overflow #5019
Comments
investigating |
The compiler doesn't seem to be generating the stack canary code on ARC.
|
|
If I manually pass -fstack-protector-all it works. This also worked fine in the old Kbuild system. |
I could investigate further why this only fails on ARC, but I think a different approach is needed. It seems we do these checks for ALL c compiler options, anytime zephyr_cc_option() is used. @SebastianBoe can we add a zephyr_cc_option_nocheck() or something like that which just adds an option unconditionally? |
Fixes zephyrproject-rtos#5019 Signed-off-by: Anas Nashif <[email protected]>
Fixes #5019 Signed-off-by: Anas Nashif <[email protected]>
The help text has been stating that CONFIG_STACK_CANARIES will silently be ignored when the compiler does not support them. But this is not the desired behaviour of CONFIG_STACK_CANARIES[1]. This patch corrects the help text to state that an error will occur if this feature is enabled, but not supported. [1] "I would much rather see the build break if someone tries to enable the stack canaries, and the compiler doesn't support it. Because what happens now is that if someone enables this option, and there is no support, the build will succeed but there are no actual stack canaries in place, and unless the user is paying close attention to the cmake test output they will have no idea." -- zephyrproject-rtos#5019 Signed-off-by: Sebastian Bøe <[email protected]>
The help text has been stating that CONFIG_STACK_CANARIES will silently be ignored when the compiler does not support them. But this is not the desired behaviour of CONFIG_STACK_CANARIES[1]. This patch corrects the help text to state that an error will occur if this feature is enabled, but not supported. [1] "I would much rather see the build break if someone tries to enable the stack canaries, and the compiler doesn't support it. Because what happens now is that if someone enables this option, and there is no support, the build will succeed but there are no actual stack canaries in place, and unless the user is paying close attention to the cmake test output they will have no idea." -- #5019 Signed-off-by: Sebastian Bøe <[email protected]>
The procedure followed to re-produce is -
Zephyr Commit ID:-
036dde2
Config file is attached to this Report:
kernel_mem_protect_stackprot_config.txt
Build Procedure-
Cmake Build procedure -
$cd $ZEPHYR_BASE/tests/kernel/mem_protect/stackprot
$mkdir build && cd build
$cmake –DBOARD=quark_se_c1000_devboard..
$make flash
Detailed description
build passed: 'mkdir -p outdir-aetj-ijnd-quark_se_c1000_ss_devboard; rm -f outdir-aetj-ijnd-quark_se_c1000_ss_devboard/.config'
build passed: 'cmake -DPREBUILT_HOST_TOOLS=
-DBOARD=quark_se_c1000_ss_devboard
-DARCH=arc -DEXTRA_CPPFLAGS="-DTC_RUNID=:ijnd"
-DEXTRA_CFLAGS="-Werror -Wno-error=deprecated-declarations"
-DEXTRA_AFLAGS=-Wa,--fatal-warnings -DEXTRA_LDFLAGS=--fatal-warnings -B"outdir-aetj-ijnd-quark_se_c1000_ss_devboard" -H"zephyr/tests/kernel/mem_protect/stackprot"'
build passed: 'mkdir -p outdir-aetj-ijnd-quark_se_c1000_devboard; rm -f outdir-aetj-ijnd-quark_se_c1000_devboard/.config'
build passed: 'cmake -DPREBUILT_HOST_TOOLS=zephyr-sdk-0.9.2/sysroots/x86_64-pokysdk-linux/usr/bin -DBOARD=quark_se_c1000_devboard -DARCH=x86
-DEXTRA_CPPFLAGS="-DTC_RUNID=:ijnd"
-DEXTRA_CFLAGS="-Werror -Wno-error=deprecated-declarations"
-DEXTRA_AFLAGS=-Wa,--fatal-warnings
-DEXTRA_LDFLAGS=--fatal-warnings -
B"outdir-aetj-ijnd-quark_se_c1000_devboard"
-H"zephyr/tests/booting/stub"'
build passed
deploy passed
Reset
console output: starting test - Test Stack Protection Canary
console output:
console output: Starts main
console output: Starts alternate_thread
console output: alternate_thread: Input string is too long and stack overflowed!
console output:
console output: alternate_thread: Stack ok
console output: alternate_thread: Stack ok
console output: alternate_thread: Stack ok
console output: alternate_thread: Stack ok
console output: alternate_thread: Stack ok
console output: alternate_thread: Stack ok
console output: Exception vector: 0x3, cause code: 0x6, parameter 0x0
console output: Address 0x206f6f74
console output: Current thread ID = 0xa8000450
console output: Faulting instruction address = 0x206f6f74
console output: Fatal fault in thread 0xa8000450! Aborting.
console output: FAIL - main.
console output:
The text was updated successfully, but these errors were encountered: