lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181206155739.20229-4-ard.biesheuvel@linaro.org>
Date:   Thu,  6 Dec 2018 16:57:37 +0100
From:   Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:     linux-kernel@...r.kernel.org
Cc:     linux-arm-kernel@...ts.infradead.org,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Robin Murphy <robin.murphy@....com>,
        Will Deacon <will.deacon@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Marc Zyngier <marc.zyngier@....com>,
        Suzuki Poulose <suzuki.poulose@....com>,
        Dave Martin <Dave.Martin@....com>
Subject: [PATCH 3/5] arm64/alternative_cb: add support for alternative sequences

Permit callback type alternatives to carry a sequence of alternative
instructions, and leave it up to the callback handler to decide how
to use them.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
---
 arch/arm64/include/asm/alternative.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
index 987c1514183a..6b7726ee6b0a 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
@@ -156,7 +156,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
 	.popsection
 	.pushsection .altinstr_replacement, "ax"
 663:	.word	\cb - .
-664:	.popsection
+	.popsection
 661:
 .endm
 
@@ -185,10 +185,21 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
 	.org	. - (662b-661b) + (664b-663b)
 .endm
 
+.macro alternative_cb_alt
+	.set .Lasm_alt_mode, 1
+	.pushsection .altinstr_replacement, "ax"
+	.org	663b + AARCH64_INSN_SIZE
+.endm
+
 /*
  * Callback-based alternative epilogue
  */
 .macro alternative_cb_end
+	.if .Lasm_alt_mode==0
+	.pushsection .altinstr_replacement, "ax"
+	.org	663b + AARCH64_INSN_SIZE
+	.endif
+664:	.popsection
 662:
 .endm
 
-- 
2.19.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ