Skip to content
Commit 51e5566c authored by Will Deacon's avatar Will Deacon Committed by Vinayak Menon
Browse files

arm64: SW PAN: Update saved ttbr0 value on enter_lazy_tlb



enter_lazy_tlb is called when a kernel thread rides on the back of
another mm, due to a context switch or an explicit call to unuse_mm
where a call to switch_mm is elided.

In these cases, it's important to keep the saved ttbr value up to date
with the active mm, otherwise we can end up with a stale value which
points to a potentially freed page table.

This patch implements enter_lazy_tlb for arm64, so that the saved ttbr0
is kept up-to-date with the active mm for kernel threads.

Change-Id: I6e5c50542ff2645c46e8801685f7a43e6773c3d2
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Cc: <stable@vger.kernel.org>
Fixes: 39bc88e5e38e9b21 ("arm64: Disable TTBR0_EL1 during normal kernel execution")
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Reported-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Git-commit: d96cc49bff5a7735576cc6f6f111f875d101cec8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 7bec5cb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment