]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: bti: Fix support for userspace only BTI
authorMark Brown <broonie@kernel.org>
Tue, 12 May 2020 11:39:50 +0000 (12:39 +0100)
committerWill Deacon <will@kernel.org>
Tue, 12 May 2020 17:45:17 +0000 (18:45 +0100)
commit6a6125c10bfed694bdb2c750e2a700774fad1bd6
tree8e36a28fbfb4f94a42f32168baedf6f3bf117361
parent0c0a52248767e5b8ca8e5ffca4e0ac483c0b9cc1
arm64: bti: Fix support for userspace only BTI

When setting PTE_MAYBE_GP we check system_supports_bti() but this is
true for systems where only CONFIG_BTI is set causing us to enable BTI
on some kernel text. Add an extra check for the kernel mode option,
using an ifdef due to line length.

Fixes: c84749afa156 ("arm64: Set GP bit in kernel page tables to enable BTI for the kernel")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200512113950.29996-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/pgtable-prot.h