Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d60d65ae authored by Marc Zyngier's avatar Marc Zyngier Committed by Isaac J. Manjarres
Browse files

arm64: ssbd: Introduce thread flag to control userspace mitigation



In order to allow userspace to be mitigated on demand, let's
introduce a new thread flag that prevents the mitigation from
being turned off when exiting to userspace, and doesn't turn
it on on entry into the kernel (with the assumption that the
mitigation is always enabled in the kernel itself).

This will be used by a prctl interface introduced in a later
patch.

Change-Id: I9583873ac796489eba615e857cb9f21adcef2179
Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Git-commit: 9dd9614f5476687abbff8d4b12cd08ae70d7c2ad
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 9be5bc93
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ void arch_setup_new_exec(void);
#define TIF_SINGLESTEP		21
#define TIF_32BIT		22	/* 32bit process */
#define TIF_MM_RELEASED		24
#define TIF_SSBD		25	/* Wants SSB mitigation */

#define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
+2 −0
Original line number Diff line number Diff line
@@ -148,6 +148,8 @@ alternative_else_nop_endif
	b.ne	\targ
	ldr_this_cpu	\tmp2, arm64_ssbd_callback_required, \tmp1
	cbz	\tmp2, \targ
	ldr	\tmp2, [tsk, #TSK_TI_FLAGS]
	tbnz	\tmp2, #TIF_SSBD, \targ
	mov	w0, #ARM_SMCCC_ARCH_WORKAROUND_2
	mov	w1, #\state
	smc	#0