All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>, <will.deacon@arm.com>,
	<sasha.levin@oracle.com>
Subject: Re: [PATCH 3/3] arm64: mm: ensure patched kernel text is fetched from PoU
Date: Mon, 15 Feb 2016 09:43:35 +0800	[thread overview]
Message-ID: <56C12D47.1060703@huawei.com> (raw)
In-Reply-To: <20160214210026.GB10498@kroah.com>

On 2016/2/15 5:00, Greg KH wrote:
> On Tue, Feb 02, 2016 at 12:06:47PM +0800, Hanjun Guo wrote:
>> From: Will Deacon <will.deacon@arm.com>
>>
>> The arm64 booting document requires that the bootloader has cleaned the
>> kernel image to the PoC. However, when a CPU re-enters the kernel due to
>> either a CPU hotplug "on" event or resuming from a low-power state (e.g.
>> cpuidle), the kernel text may in-fact be dirty at the PoU due to things
>> like alternative patching or even module loading.
>>
>> Thanks to I-cache speculation with the MMU off, stale instructions could
>> be fetched prior to enabling the MMU, potentially leading to crashes
>> when executing regions of code that have been modified at runtime.
>>
>> This patch addresses the issue by ensuring that the local I-cache is
>> invalidated immediately after a CPU has enabled its MMU but before
>> jumping out of the identity mapping. Any stale instructions fetched from
>> the PoC will then be discarded and refetched correctly from the PoU.
>> Patching kernel text executed prior to the MMU being enabled is
>> prohibited, so the early entry code will always be clean.
>>
>> Reviewed-by: Mark Rutland <mark.rutland@arm.com>
>> Tested-by: Mark Rutland <mark.rutland@arm.com>
>> Signed-off-by: Will Deacon <will.deacon@arm.com>
>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>> ---
>>  arch/arm64/kernel/head.S  | 8 ++++++++
>>  arch/arm64/kernel/sleep.S | 8 ++++++++
>>  arch/arm64/mm/proc.S      | 1 -
>>  3 files changed, 16 insertions(+), 1 deletion(-)
> You forgot to say what the upstream git commit id is for this :(
>

Sorry, it's 8ec41987436d566f7c4559c6871738b869f7ef07.

Thanks
Hanjun


  reply	other threads:[~2016-02-15  1:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02  4:06 [PATCH 0/3] Candidate ARM64 stable patches for linux-4.1.y Hanjun Guo
2016-02-02  4:06 ` [PATCH 1/3] arm64: fix missing syscall trace exit Hanjun Guo
2016-02-02  4:06 ` [PATCH 2/3] arm64: entry: always restore x0 from the stack on syscall return Hanjun Guo
2016-02-02  4:06 ` [PATCH 3/3] arm64: mm: ensure patched kernel text is fetched from PoU Hanjun Guo
2016-02-14 21:00   ` Greg KH
2016-02-15  1:43     ` Hanjun Guo [this message]
2016-02-14 21:00 ` [PATCH 0/3] Candidate ARM64 stable patches for linux-4.1.y Greg KH
2016-02-15  1:35   ` Hanjun Guo
2016-02-15  1:44     ` Greg KH
2016-02-16  5:59       ` Hanjun Guo
2016-02-16  6:09         ` Sasha Levin

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=56C12D47.1060703@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=sasha.levin@oracle.com \
    --cc=stable@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.