Commit 98a97bf4 authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas
Browse files

arm64/gcs: Flush the GCS locking state on exec



When we exec a new task we forget to flush the set of locked GCS mode bits.
Since we do flush the rest of the state this means that if GCS is locked
the new task will be unable to enable GCS, it will be locked as being
disabled. Add the expected flush.

Fixes: fc84bc53 ("arm64/gcs: Context switch GCS state for EL0")
Cc: <stable@vger.kernel.org> # 6.13.x
Reported-by: default avatarYury Khrustalev <Yury.Khrustalev@arm.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Tested-by: default avatarYury Khrustalev <yury.khrustalev@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 63de2b38
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -292,6 +292,7 @@ static void flush_gcs(void)
	current->thread.gcs_base = 0;
	current->thread.gcs_size = 0;
	current->thread.gcs_el0_mode = 0;
	current->thread.gcs_el0_locked = 0;
	write_sysreg_s(GCSCRE0_EL1_nTR, SYS_GCSCRE0_EL1);
	write_sysreg_s(0, SYS_GCSPR_EL0);
}