diff mbox series

[v2,2/2] selftests/lkdtm: Add UBSAN config

Message ID 20220121145154.1795447-2-usama.anjum@collabora.com (mailing list archive)
State Accepted
Commit 1900be289b598b2c553b3add13e491c0bb8a8550
Headers show
Series [v2,1/2] selftests/lkdtm: Remove dead config option | expand

Commit Message

Muhammad Usama Anjum Jan. 21, 2022, 2:51 p.m. UTC
UBSAN_BOUNDS and UBSAN_TRAP depend on UBSAN config option.
merge_config.sh script generates following warnings if parent config
doesn't have UBSAN config already enabled and UBSAN_BOUNDS/UBSAN_TRAP
config options don't get added to the parent config.

Value requested for CONFIG_UBSAN_BOUNDS not in final .config
Requested value:  CONFIG_UBSAN_BOUNDS=y
Actual value:

Value requested for CONFIG_UBSAN_TRAP not in final .config
Requested value:  CONFIG_UBSAN_TRAP=y
Actual value:

Fix this by including UBSAN config.

Fixes: c75be56e35b2 ("lkdtm/bugs: Add ARRAY_BOUNDS to selftests")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
Changes in V2:
	Add Fixes tag
---
 tools/testing/selftests/lkdtm/config | 1 +
 1 file changed, 1 insertion(+)

Comments

Kees Cook Jan. 21, 2022, 9:17 p.m. UTC | #1
On Fri, Jan 21, 2022 at 07:51:53PM +0500, Muhammad Usama Anjum wrote:
> UBSAN_BOUNDS and UBSAN_TRAP depend on UBSAN config option.
> merge_config.sh script generates following warnings if parent config
> doesn't have UBSAN config already enabled and UBSAN_BOUNDS/UBSAN_TRAP
> config options don't get added to the parent config.
> 
> Value requested for CONFIG_UBSAN_BOUNDS not in final .config
> Requested value:  CONFIG_UBSAN_BOUNDS=y
> Actual value:
> 
> Value requested for CONFIG_UBSAN_TRAP not in final .config
> Requested value:  CONFIG_UBSAN_TRAP=y
> Actual value:
> 
> Fix this by including UBSAN config.
> 
> Fixes: c75be56e35b2 ("lkdtm/bugs: Add ARRAY_BOUNDS to selftests")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

Acked-by: Kees Cook <keescook@chromium.org>
diff mbox series

Patch

diff --git a/tools/testing/selftests/lkdtm/config b/tools/testing/selftests/lkdtm/config
index a7a58f885f52a..46f39ee762086 100644
--- a/tools/testing/selftests/lkdtm/config
+++ b/tools/testing/selftests/lkdtm/config
@@ -5,6 +5,7 @@  CONFIG_FORTIFY_SOURCE=y
 CONFIG_HARDENED_USERCOPY=y
 CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
+CONFIG_UBSAN=y
 CONFIG_UBSAN_BOUNDS=y
 CONFIG_UBSAN_TRAP=y
 CONFIG_STACKPROTECTOR_STRONG=y