]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
arm64: add sentinel to kpti_safe_list
authorMark Rutland <mark.rutland@arm.com>
Wed, 15 Jan 2020 17:36:38 +0000 (18:36 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 13:55:03 +0000 (10:55 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857074
BugLink: https://bugs.launchpad.net/bugs/1853485
BugLink: https://bugs.launchpad.net/bugs/1853326
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 <mark.rutland@arm.com>
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(backported from commit 71c751f2a43fa03fae3cf5f0067ed3001a397013)
[juergh: Adjusted context.]
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
arch/arm64/kernel/cpufeature.c

index 3d332823ba93bcdc75f0620c17b1ac4cd593c7da..c9474f33549fe487e479ee0c52aedccdee21c8e0 100644 (file)
@@ -897,6 +897,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
                MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
                MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
                MIDR_ALL_VERSIONS(MIDR_HISI_TSV110),
+               { /* sentinel */ }
        };
        char const *str = "kpti command line option";
        bool meltdown_safe;