Skip to content
Commit 9e09b750 authored by Ruowen Qin's avatar Ruowen Qin Committed by Andrii Nakryiko
Browse files

samples/bpf: Add -fsanitize=bounds to userspace programs



The sanitizer flag, which is supported by both clang and gcc, would make
it easier to debug array index out-of-bounds problems in these programs.

Make the Makfile smarter to detect ubsan support from the compiler and
add the '-fsanitize=bounds' accordingly.

Suggested-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarJinghao Jia <jinghao@linux.ibm.com>
Signed-off-by: default avatarJinghao Jia <jinghao7@illinois.edu>
Signed-off-by: default avatarRuowen Qin <ruowenq2@illinois.edu>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Tested-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20230927045030.224548-2-ruowenq2@illinois.edu
parent 0e73ef1d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment