From: Amit Daniel Kachhap <amit.kachhap@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>,
Kees Cook <keescook@chromium.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Kristina Martsenko <kristina.martsenko@arm.com>,
Mark Brown <broonie@kernel.org>,
James Morse <james.morse@arm.com>,
Amit Daniel Kachhap <amit.kachhap@arm.com>,
Vincenzo Frascino <Vincenzo.Frascino@arm.com>,
Will Deacon <will@kernel.org>, Dave Martin <Dave.Martin@arm.com>
Subject: [PATCH 2/2] arm64: kprobe: disable probe of fault prone ptrauth instruction
Date: Wed, 19 Feb 2020 18:30:40 +0530 [thread overview]
Message-ID: <1582117240-15330-3-git-send-email-amit.kachhap@arm.com> (raw)
In-Reply-To: <1582117240-15330-1-git-send-email-amit.kachhap@arm.com>
This patch disables the probing of authenticate ptrauth instruction
(AUTIASP) which falls under the hint instructions region. This is done
to disallow probe of authenticate instruction in the kernel which may
lead to ptrauth faults with the addition of Armv8.6 enhanced ptrauth
features.
The corresponding append pac ptrauth instruction (PACIASP) is not disabled
and they can still be probed.
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
---
arch/arm64/include/asm/insn.h | 13 +++++++------
arch/arm64/kernel/insn.c | 1 +
arch/arm64/kernel/probes/decode-insn.c | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h
index bb313dd..2e01db0 100644
--- a/arch/arm64/include/asm/insn.h
+++ b/arch/arm64/include/asm/insn.h
@@ -40,12 +40,13 @@ enum aarch64_insn_encoding_class {
};
enum aarch64_insn_hint_op {
- AARCH64_INSN_HINT_NOP = 0x0 << 5,
- AARCH64_INSN_HINT_YIELD = 0x1 << 5,
- AARCH64_INSN_HINT_WFE = 0x2 << 5,
- AARCH64_INSN_HINT_WFI = 0x3 << 5,
- AARCH64_INSN_HINT_SEV = 0x4 << 5,
- AARCH64_INSN_HINT_SEVL = 0x5 << 5,
+ AARCH64_INSN_HINT_NOP = 0x0 << 5,
+ AARCH64_INSN_HINT_YIELD = 0x1 << 5,
+ AARCH64_INSN_HINT_WFE = 0x2 << 5,
+ AARCH64_INSN_HINT_WFI = 0x3 << 5,
+ AARCH64_INSN_HINT_SEV = 0x4 << 5,
+ AARCH64_INSN_HINT_SEVL = 0x5 << 5,
+ AARCH64_INSN_HINT_AUTIASP = (0x3 << 8) | (0x5 << 5),
};
enum aarch64_insn_imm_type {
diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
index 4a9e773..87f7c8a 100644
--- a/arch/arm64/kernel/insn.c
+++ b/arch/arm64/kernel/insn.c
@@ -63,6 +63,7 @@ bool __kprobes aarch64_insn_is_nop(u32 insn)
case AARCH64_INSN_HINT_WFI:
case AARCH64_INSN_HINT_SEV:
case AARCH64_INSN_HINT_SEVL:
+ case AARCH64_INSN_HINT_AUTIASP:
return false;
default:
return true;
diff --git a/arch/arm64/kernel/probes/decode-insn.c b/arch/arm64/kernel/probes/decode-insn.c
index b78fac9..a7caf84 100644
--- a/arch/arm64/kernel/probes/decode-insn.c
+++ b/arch/arm64/kernel/probes/decode-insn.c
@@ -42,7 +42,7 @@ static bool __kprobes aarch64_insn_is_steppable(u32 insn)
!= AARCH64_INSN_SPCLREG_DAIF;
/*
- * The HINT instruction is is problematic when single-stepping,
+ * The HINT instruction is problematic when single-stepping,
* except for the NOP case.
*/
if (aarch64_insn_is_hint(insn))
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-02-19 13:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 13:00 [PATCH 0/2] arm64: add Armv8.6 pointer authentication Amit Daniel Kachhap
2020-02-19 13:00 ` [PATCH 1/2] arm64: ptrauth: add pointer authentication Armv8.6 enhanced feature Amit Daniel Kachhap
2020-02-28 11:57 ` Will Deacon
2020-02-28 12:03 ` Mark Rutland
2020-02-28 12:23 ` Will Deacon
2020-03-02 12:48 ` Amit Kachhap
2020-03-02 16:29 ` Will Deacon
2020-02-19 13:00 ` Amit Daniel Kachhap [this message]
2020-02-27 16:48 ` [PATCH 2/2] arm64: kprobe: disable probe of fault prone ptrauth instruction Mark Rutland
2020-02-28 11:12 ` Amit Kachhap
2020-02-28 11:18 ` Will Deacon
2020-02-28 11:31 ` Mark Rutland
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=1582117240-15330-3-git-send-email-amit.kachhap@arm.com \
--to=amit.kachhap@arm.com \
--cc=Dave.Martin@arm.com \
--cc=Vincenzo.Frascino@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=keescook@chromium.org \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.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