public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Benjamin Gray <bgray@linux•ibm.com>
To: linuxppc-dev@lists•ozlabs.org
Cc: Benjamin Gray <bgray@linux•ibm.com>
Subject: [PATCH] powerpc/kasan: Disable KCOV in KASAN code
Date: Mon, 10 Jul 2023 14:41:43 +1000	[thread overview]
Message-ID: <20230710044143.146840-1-bgray@linux.ibm.com> (raw)

As per the generic KASAN code in mm/kasan, disable KCOV with
KCOV_INSTRUMENT := n in the makefile.

This fixes a ppc64 boot hang when KCOV and KASAN are enabled.
kasan_early_init() gets called before a PACA is initialised, but the
KCOV hook expects a valid PACA.

Suggested-by: Christophe Leroy <christophe.leroy@csgroup•eu>
Signed-off-by: Benjamin Gray <bgray@linux•ibm.com>

---

The generic makefile has other disabled sanitisers / hooks, but this
patch is just an upstream of fixing a blocking issue for running
syzkaller. The blocker is resolved by this; kernels stop hanging on boot
with KCOV + KASAN.

This works as an alternative to
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20230707013110.215693-1-bgray@linux.ibm.com/
---
 arch/powerpc/mm/kasan/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/mm/kasan/Makefile b/arch/powerpc/mm/kasan/Makefile
index 699eeffd9f55..f9522fd70b2f 100644
--- a/arch/powerpc/mm/kasan/Makefile
+++ b/arch/powerpc/mm/kasan/Makefile
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 KASAN_SANITIZE := n
+KCOV_INSTRUMENT := n
 
 obj-$(CONFIG_PPC32)		+= init_32.o
 obj-$(CONFIG_PPC_8xx)		+= 8xx.o
-- 
2.41.0


             reply	other threads:[~2023-07-10  4:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  4:41 Benjamin Gray [this message]
2023-07-20 13:50 ` [PATCH] powerpc/kasan: Disable KCOV in KASAN code Michael Ellerman

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=20230710044143.146840-1-bgray@linux.ibm.com \
    --to=bgray@linux$(echo .)ibm.com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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