Skip to content

Commit 6415e2c

Browse files
theihorKernel Patches Daemon
authored andcommitted
selftests/bpf: Don't override SIGSEGV handler with ASAN
test_progs has custom SIGSEGV handler, which interferes with the address sanitizer [1]. Add an #ifndef to avoid this. [1] https://lore.kernel.org/bpf/73d832948b01dbc0ebc60d85574bdf8537f3a810.camel@gmail.com/ Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Acked-by: Mykyta Yatsenko <yatsenko@meta.com>|
1 parent 4406a02 commit 6415e2c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/testing/selftests/bpf/test_progs.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,13 +1944,15 @@ int main(int argc, char **argv)
19441944
.parser = parse_arg,
19451945
.doc = argp_program_doc,
19461946
};
1947+
int err, i;
1948+
1949+
#ifndef __SANITIZE_ADDRESS__
19471950
struct sigaction sigact = {
19481951
.sa_handler = crash_handler,
19491952
.sa_flags = SA_RESETHAND,
1950-
};
1951-
int err, i;
1952-
1953+
};
19531954
sigaction(SIGSEGV, &sigact, NULL);
1955+
#endif
19541956

19551957
env.stdout_saved = stdout;
19561958
env.stderr_saved = stderr;

0 commit comments

Comments
 (0)