mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 7/9] sandbox: rename KASan to ASan
Date: Fri, 18 Sep 2020 10:45:30 +0200	[thread overview]
Message-ID: <20200918084532.2794-8-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20200918084532.2794-1-s.hauer@pengutronix.de>

sandbox really has ASan support, that is address sanitizer with the help
of the userspace library libasan. In contrast KASan is used on real
hardware where we have to implement our own support code. Rename sandbox
KASan to ASan to not clash with upcoming KASan support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/sandbox/Kconfig     |  4 ++--
 arch/sandbox/Makefile    |  2 +-
 arch/sandbox/os/Makefile |  4 ----
 arch/sandbox/os/common.c |  2 +-
 common/Kconfig           | 10 +++++-----
 5 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 40e04919d2..81f7a96bd6 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -5,7 +5,7 @@ config SANDBOX
 	select OFTREE
 	select GPIOLIB
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
-	select HAVE_ARCH_KASAN
+	select HAVE_ARCH_ASAN
 	select HAS_DMA
 	default y
 
@@ -22,7 +22,7 @@ config SANDBOX_UNWIND
 	bool
 	default y
 	select ARCH_HAS_STACK_DUMP
-	depends on UBSAN || KASAN
+	depends on UBSAN || ASAN
 
 config PHYS_ADDR_T_64BIT
 	bool
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 27021222dc..ce1fe3b672 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -44,7 +44,7 @@ ifeq ($(CONFIG_GPIO_LIBFTDI1),y)
 FTDI1_LIBS := $(shell pkg-config libftdi1 --libs)
 endif
 
-ifeq ($(CONFIG_KASAN),y)
+ifeq ($(CONFIG_ASAN),y)
 KBUILD_CPPFLAGS += -fsanitize=address
 SANITIZER_LIBS += -fsanitize=address
 endif
diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile
index b2bd768bcb..15d688bfdd 100644
--- a/arch/sandbox/os/Makefile
+++ b/arch/sandbox/os/Makefile
@@ -8,10 +8,6 @@ KBUILD_CPPFLAGS += -DCONFIG_MALLOC_SIZE=$(CONFIG_MALLOC_SIZE)
 
 KBUILD_CFLAGS := -Wall
 
-ifeq ($(CONFIG_KASAN),y)
-KBUILD_CPPFLAGS += -DCONFIG_KASAN=1
-endif
-
 NOSTDINC_FLAGS :=
 
 ifeq ($(CONFIG_SANDBOX_LINUX_I386),y)
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 69fadb3b47..9fb5faf41d 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
 	int fdno = 0, envno = 0, option_index = 0;
 	char *aux;
 
-#ifdef CONFIG_KASAN
+#ifdef CONFIG_ASAN
 	__sanitizer_set_death_callback(cookmode);
 #endif
 
diff --git a/common/Kconfig b/common/Kconfig
index b350f5c355..3626eb2f29 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1375,11 +1375,11 @@ config PBL_BREAK
 
 source "lib/Kconfig.ubsan"
 
-config KASAN
-	bool "KASAN: runtime memory debugger"
-	depends on HAVE_ARCH_KASAN
+config ASAN
+	bool "ASAN: runtime memory debugger"
+	depends on HAVE_ARCH_ASAN
 	help
-	  Enables KASAN (KernelAddressSANitizer) - runtime memory debugger,
+	  Enables ASAN (AddressSANitizer) - runtime memory debugger,
 	  designed to find out-of-bounds accesses and use-after-free bugs.
 
 config COMPILE_TEST
@@ -1404,5 +1404,5 @@ config DDR_SPD
 	bool
 	select CRC_ITU_T
 
-config HAVE_ARCH_KASAN
+config HAVE_ARCH_ASAN
 	bool
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-09-18  8:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18  8:45 [PATCH 0/9] barebox KASan support Sascha Hauer
2020-09-18  8:45 ` [PATCH 1/9] Add print_hex_dump kernel implementation Sascha Hauer
2020-09-18  8:45 ` [PATCH 2/9] Add _RET_IP_ macro Sascha Hauer
2020-09-18  8:45 ` [PATCH 3/9] Kallsyms: Also resolve global variables Sascha Hauer
2020-09-22 16:17   ` Michael Grzeschik
2020-09-28  8:30     ` Sascha Hauer
2020-09-18  8:45 ` [PATCH 4/9] Add constructor support Sascha Hauer
2020-09-18  8:45 ` [PATCH 5/9] pbl: Alias memcpy and memset Sascha Hauer
2020-09-18  8:45 ` [PATCH 6/9] string: Add nokasan variants of default memcpy/memset Sascha Hauer
2020-09-18  8:45 ` Sascha Hauer [this message]
2020-09-18  8:45 ` [PATCH 8/9] Add KASan support Sascha Hauer
2020-09-18 10:15   ` Ahmad Fatoum
2020-09-21  6:24     ` Sascha Hauer
2020-09-18  8:45 ` [PATCH 9/9] ARM: " Sascha Hauer
2021-02-09  9:25   ` Ahmad Fatoum
2021-02-10  9:26     ` Sascha Hauer
2021-02-10  9:27       ` Ahmad Fatoum
2020-09-28 14:33 ` [PATCH 0/9] barebox " Ahmad Fatoum
2020-09-28 15:06   ` Sascha Hauer

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=20200918084532.2794-8-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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