linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mips: Enable KCSAN
@ 2022-01-31 10:17 Nemanja Rakovic
  2022-02-07 17:36 ` Thomas Bogendoerfer
  2022-02-11 13:15 ` Marco Elver
  0 siblings, 2 replies; 3+ messages in thread
From: Nemanja Rakovic @ 2022-01-31 10:17 UTC (permalink / raw)
  To: linux-mips
  Cc: Nemanja Rakovic, Thomas Bogendoerfer, linux-kernel,
	dragan.mladjenovic

This patch enables KCSAN for the 64-bit version. Updated rules
for the incompatible compilation units (vdso, boot/compressed).

Signed-off-by: Nemanja Rakovic <nemanja.rakovic@syrmia.com>
---
 arch/mips/Kconfig                  | 1 +
 arch/mips/boot/compressed/Makefile | 1 +
 arch/mips/vdso/Makefile            | 3 +++
 3 files changed, 5 insertions(+)

Changes were tested on qemu (qemu-system-mips64el) with the
64r6el_defconfig configuration and KCSAN enabled.

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 058446f01487..651d4fe355da 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -101,6 +101,7 @@ config MIPS
 	select TRACE_IRQFLAGS_SUPPORT
 	select VIRT_TO_BUS
 	select ARCH_HAS_ELFCORE_COMPAT
+	select HAVE_ARCH_KCSAN if 64BIT
 
 config MIPS_FIXUP_BIGPHYS_ADDR
 	bool
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 5a15d51e8884..a35f78212ea9 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -38,6 +38,7 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
 KCOV_INSTRUMENT		:= n
 GCOV_PROFILE := n
 UBSAN_SANITIZE := n
+KASAN_SANITIZE			:= n
 
 # decompressor objects (linked with vmlinuz)
 vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index d65f55f67e19..f72658b3a53f 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -1,6 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0
 # Objects to go into the VDSO.
 
+# Sanitizer runtimes are unavailable and cannot be linked here.
+ KCSAN_SANITIZE			:= n
+
 # Absolute relocation type $(ARCH_REL_TYPE_ABS) needs to be defined before
 # the inclusion of generic Makefile.
 ARCH_REL_TYPE_ABS := R_MIPS_JUMP_SLOT|R_MIPS_GLOB_DAT
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mips: Enable KCSAN
  2022-01-31 10:17 [PATCH] mips: Enable KCSAN Nemanja Rakovic
@ 2022-02-07 17:36 ` Thomas Bogendoerfer
  2022-02-11 13:15 ` Marco Elver
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2022-02-07 17:36 UTC (permalink / raw)
  To: Nemanja Rakovic; +Cc: linux-mips, linux-kernel, dragan.mladjenovic

On Mon, Jan 31, 2022 at 11:17:09AM +0100, Nemanja Rakovic wrote:
> This patch enables KCSAN for the 64-bit version. Updated rules
> for the incompatible compilation units (vdso, boot/compressed).
> 
> Signed-off-by: Nemanja Rakovic <nemanja.rakovic@syrmia.com>
> ---
>  arch/mips/Kconfig                  | 1 +
>  arch/mips/boot/compressed/Makefile | 1 +
>  arch/mips/vdso/Makefile            | 3 +++
>  3 files changed, 5 insertions(+)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mips: Enable KCSAN
  2022-01-31 10:17 [PATCH] mips: Enable KCSAN Nemanja Rakovic
  2022-02-07 17:36 ` Thomas Bogendoerfer
@ 2022-02-11 13:15 ` Marco Elver
  1 sibling, 0 replies; 3+ messages in thread
From: Marco Elver @ 2022-02-11 13:15 UTC (permalink / raw)
  To: Nemanja Rakovic
  Cc: linux-mips, Thomas Bogendoerfer, linux-kernel, dragan.mladjenovic

On Mon, Jan 31, 2022 at 11:17AM +0100, Nemanja Rakovic wrote:
> This patch enables KCSAN for the 64-bit version. Updated rules
> for the incompatible compilation units (vdso, boot/compressed).
> 
> Signed-off-by: Nemanja Rakovic <nemanja.rakovic@syrmia.com>
[...]
> diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> index 5a15d51e8884..a35f78212ea9 100644
> --- a/arch/mips/boot/compressed/Makefile
> +++ b/arch/mips/boot/compressed/Makefile
> @@ -38,6 +38,7 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
>  KCOV_INSTRUMENT		:= n
>  GCOV_PROFILE := n
>  UBSAN_SANITIZE := n
> +KASAN_SANITIZE			:= n
>  

Should this have said KCSAN_SANITIZE? You probably want one for
KASAN_SANITIZE as well, but probably not in this patch, given mips
doesn't support KASAN yet (AFAIK).

Thanks,
-- Marco

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-11 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-31 10:17 [PATCH] mips: Enable KCSAN Nemanja Rakovic
2022-02-07 17:36 ` Thomas Bogendoerfer
2022-02-11 13:15 ` Marco Elver

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).