We're missing a sentinel entry in kpti_safe_list. Thus is_midr_in_range_list()
can walk past the end of kpti_safe_list. Depending on the contents of memory,
this could erroneously match a CPU's MIDR, cause a data abort, or other bad
outcomes.
Add the sentinel entry to avoid this.
Fixes: be5b299830c63ed7 ("arm64: capabilities: Add support for checks based on a list of MIDRs")
Signed-off-by: Mark Rutland <email address hidden>
Reported-by: Jan Kiszka <email address hidden>
Tested-by: Jan Kiszka <email address hidden>
Reviewed-by: Suzuki K Poulose <email address hidden>
Cc: Catalin Marinas <email address hidden>
Cc: Suzuki K Poulose <email address hidden>
Cc: Will Deacon <email address hidden>
Signed-off-by: Will Deacon <email address hidden>
We certainly want this:
commit 71c751f2a43fa03 fae3cf5f0067ed3 001a397013
Author: Mark Rutland <email address hidden>
Date: Mon Apr 23 11:41:33 2018 +0100
arm64: add sentinel to kpti_safe_list
We're missing a sentinel entry in kpti_safe_list. Thus is_midr_ in_range_ list()
can walk past the end of kpti_safe_list. Depending on the contents of memory,
this could erroneously match a CPU's MIDR, cause a data abort, or other bad
outcomes.
Add the sentinel entry to avoid this.
Fixes: be5b299830c63ed7 ("arm64: capabilities: Add support for checks based on a list of MIDRs")
Signed-off-by: Mark Rutland <email address hidden>
Reported-by: Jan Kiszka <email address hidden>
Tested-by: Jan Kiszka <email address hidden>
Reviewed-by: Suzuki K Poulose <email address hidden>
Cc: Catalin Marinas <email address hidden>
Cc: Suzuki K Poulose <email address hidden>
Cc: Will Deacon <email address hidden>
Signed-off-by: Will Deacon <email address hidden>
diff --git a/arch/ arm64/kernel/ cpufeature. c b/arch/ arm64/kernel/ cpufeature. c .9d1b06d67c53 100644 arm64/kernel/ cpufeature. c arm64/kernel/ cpufeature. c at_el0( const struct arm64_cpu_ capabilities *entry,
MIDR_ ALL_VERSIONS( MIDR_CAVIUM_ THUNDERX2) ,
MIDR_ ALL_VERSIONS( MIDR_BRCM_ VULCAN) ,
index 536d572e5596.
--- a/arch/
+++ b/arch/
@@ -868,6 +868,7 @@ static bool unmap_kernel_
static const struct midr_range kpti_safe_list[] = {
+ { /* sentinel */ }
};
char const *str = "command line option";