From: Palmer Dabbelt <palmer@dabbelt.com>
To: jszhang3@mail.ustc.edu.cn
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: Enable Undefined Behavior Sanitizer UBSAN
Date: Tue, 24 Aug 2021 21:45:00 -0700 (PDT) [thread overview]
Message-ID: <mhng-9d810d01-99cd-4e1c-8642-d9caf3e0a9bc@palmerdabbelt-glaptop> (raw)
In-Reply-To: <20210805003059.26b03ec0@xhacker>
On Wed, 04 Aug 2021 09:30:59 PDT (-0700), jszhang3@mail.ustc.edu.cn wrote:
> From: Jisheng Zhang <jszhang@kernel.org>
>
> Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to
> enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for
> ubsan checks.
>
> VDSO is excluded because its build doesn't include the
> __ubsan_handle_*() functions from lib/ubsan.c, and the VDSO has no
> sane way to report errors even if it has definitions of these functions.
>
> Passed lib/test_ubsan.c test.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> arch/riscv/Kconfig | 1 +
> arch/riscv/kernel/vdso/Makefile | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index f133ac72572f..cccb95bf8331 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -28,6 +28,7 @@ config RISCV
> select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
> select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
> select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
> + select ARCH_HAS_UBSAN_SANITIZE_ALL
> select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
> select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
> select ARCH_STACKWALK
> diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
> index 24d936c147cd..30a5335bd317 100644
> --- a/arch/riscv/kernel/vdso/Makefile
> +++ b/arch/riscv/kernel/vdso/Makefile
> @@ -36,6 +36,7 @@ CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
> GCOV_PROFILE := n
> KCOV_INSTRUMENT := n
> KASAN_SANITIZE := n
> +UBSAN_SANITIZE := n
>
> # Force dependency
> $(obj)/vdso.o: $(obj)/vdso.so
Thanks, this is on for-next.
prev parent reply other threads:[~2021-08-25 4:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 16:30 [PATCH] riscv: Enable Undefined Behavior Sanitizer UBSAN Jisheng Zhang
2021-08-25 4:45 ` Palmer Dabbelt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mhng-9d810d01-99cd-4e1c-8642-d9caf3e0a9bc@palmerdabbelt-glaptop \
--to=palmer@dabbelt.com \
--cc=aou@eecs.berkeley.edu \
--cc=jszhang3@mail.ustc.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=paul.walmsley@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).