Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: fc84bc5378a8 ("arm64/gcs: Context switch GCS state for EL0")
Cc: <stable@vger.kernel.org> # 6.13.x
Reported-by: Yury Khrustalev <Yury.Khrustalev@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Tested-by: Yury Khrustalev <yury.khrustalev@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Mark Brown and committed by
Catalin Marinas
98a97bf4 63de2b38

+1
+1
arch/arm64/kernel/process.c
··· 292 292 current->thread.gcs_base = 0; 293 293 current->thread.gcs_size = 0; 294 294 current->thread.gcs_el0_mode = 0; 295 + current->thread.gcs_el0_locked = 0; 295 296 write_sysreg_s(GCSCRE0_EL1_nTR, SYS_GCSCRE0_EL1); 296 297 write_sysreg_s(0, SYS_GCSPR_EL0); 297 298 }