]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR target/96260 - KASAN should work even back-end not porting anything.
authorKito Cheng <kito.cheng@sifive.com>
Wed, 22 Jul 2020 06:50:40 +0000 (14:50 +0800)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:19:03 +0000 (13:19 -0300)
commita0bba1d1c910817cc0d3a01ddfe4a2bd3784d252
treea1a81a5b9065070e7984d3c35a0d943938e7e19a
parent1b5847cb66c433fbc4c5282f375ac2c7eba74a84
PR target/96260 - KASAN should work even back-end not porting anything.

 - Most KASAN function don't need any porting anything in back-end
   except asan stack protection.

 - However kernel will given shadow offset when enable asan stack
   protection, so eveything in KASAN can work if shadow offset is given.

 - Verified with x86 and risc-v.

 - Verified with RISC-V linux kernel.

gcc/ChangeLog:

PR target/96260
* asan.c (asan_shadow_offset_set_p): New.
* asan.h (asan_shadow_offset_set_p): Ditto.
* toplev.c (process_options): Allow -fsanitize=kernel-address
even TARGET_ASAN_SHADOW_OFFSET not implemented, only check when
asan stack protection is enabled.

gcc/testsuite/ChangeLog:

PR target/96260
* gcc.target/riscv/pr91441.c: Update warning message.
* gcc.target/riscv/pr96260.c: New.
gcc/asan.c
gcc/asan.h
gcc/testsuite/gcc.target/riscv/pr91441.c
gcc/testsuite/gcc.target/riscv/pr96260.c [new file with mode: 0644]
gcc/toplev.c