From: jan.kiszka@web.de (Jan Kiszka)
To: linux-arm-kernel@lists.infradead.org
Subject: BUG: KASAN: global-out-of-bounds in unmap_kernel_at_el0+0x70/0x1a0
Date: Mon, 23 Apr 2018 12:33:17 +0200 [thread overview]
Message-ID: <02ba4513-7913-6415-5252-9cb7d75f3687@web.de> (raw)
In-Reply-To: <20180423102909.ra2n6tqvwcn7oash@lakrids.cambridge.arm.com>
On 2018-04-23 12:29, Mark Rutland wrote:
> On Mon, Apr 23, 2018 at 07:00:52AM +0200, Jan Kiszka wrote:
>> On 2018-04-22 21:06, Mark Rutland wrote:
>
>>> Does the below help?
>
>>> From ade322407e3d6d1f50e558ebd50d2c1c7bd811c2 Mon Sep 17 00:00:00 2001
>>> From: Mark Rutland <mark.rutland@arm.com>
>>> Date: Sun, 22 Apr 2018 19:58:08 +0100
>>> Subject: [PATCH] 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 <mark.rutland@arm.com>
>>> Reported-by: Jan Kiszka <jan.kiszka@web.de>
>>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
>>> Cc: Will Deacon <will.deacon@arm.com>
>>> ---
>>> arch/arm64/kernel/cpufeature.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
>>> index 536d572e5596..9d1b06d67c53 100644
>>> --- a/arch/arm64/kernel/cpufeature.c
>>> +++ b/arch/arm64/kernel/cpufeature.c
>>> @@ -868,6 +868,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
>>> static const struct midr_range kpti_safe_list[] = {
>>> MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2),
>>> MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN),
>>> + { /* sentinel */ }
>>> };
>>> char const *str = "command line option";
>>>
>>>
>>
>> Jep, all fine now!
>
> Cool. Can I take that as a Tested-by?
Yes, sorry:
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180423/650bd2e9/attachment.sig>
next prev parent reply other threads:[~2018-04-23 10:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-22 10:47 BUG: KASAN: global-out-of-bounds in unmap_kernel_at_el0+0x70/0x1a0 Jan Kiszka
2018-04-22 19:06 ` Mark Rutland
2018-04-23 5:00 ` Jan Kiszka
2018-04-23 10:29 ` Mark Rutland
2018-04-23 10:33 ` Jan Kiszka [this message]
2018-04-23 10:39 ` Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02ba4513-7913-6415-5252-9cb7d75f3687@web.de \
--to=jan.kiszka@web.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox