From: peter.maydell@linaro.org (Peter Maydell)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v2] arm64: fault: Don't leak data in ESR context for user fault on kernel VA
Date: Tue, 22 May 2018 14:48:29 +0100 [thread overview]
Message-ID: <CAFEAcA9i4_neKwaWPm_gV=fAgASL4B9X8Z++c+NvGA+JYSdDZA@mail.gmail.com> (raw)
In-Reply-To: <20180522133826.GE26955@arm.com>
On 22 May 2018 at 14:38, Will Deacon <will.deacon@arm.com> wrote:
> Hi Peter,
>
> Sorry for the delay in getting to this! Comments inline.
>
> On Thu, Apr 19, 2018 at 04:48:33PM +0100, Peter Maydell wrote:
>> + /*
>> + * These bits provide only information about the
>> + * faulting instruction, which userspace knows already.
>> + * We explicitly clear bits which are architecturally
>> + * RES0 in case they are given meanings in future.
>> + */
>> + if (esr & ESR_ELx_ISV)
>> + esr &= ESR_ELx_EC_MASK | ESR_ELx_IL |
>> + ESR_ELx_ISV | ESR_ELx_SAS |
>> + ESR_ELx_SSE | ESR_ELx_SRT_MASK |
>> + ESR_ELx_SF | ESR_ELx_AR | ESR_ELx_CM |
>> + ESR_ELx_WNR;
>
> Reading through the ARM ARM, it seems to say that ISV is always 0 for
> faults reported in ESR_EL1, which implies we can drop ISV, SAS, SSE, SRT,
> SF and AR from this list and actually drop the conditional altogether.
Mmm, I guess so, if we're guaranteed to only be working with ESRs
taken to EL1 (or we want to present userspace with an ESR that
looks like that regardless of what EL we took it to). I'll respin
without the conditional.
thanks
-- PMM
next prev parent reply other threads:[~2018-05-22 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 15:48 [RFC PATCH v2] arm64: fault: Don't leak data in ESR context for user fault on kernel VA Peter Maydell
2018-05-22 13:38 ` Will Deacon
2018-05-22 13:48 ` Peter Maydell [this message]
2018-05-22 14:11 ` Dave Martin
2018-05-22 14:30 ` Peter Maydell
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='CAFEAcA9i4_neKwaWPm_gV=fAgASL4B9X8Z++c+NvGA+JYSdDZA@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).