From: Kevin Brodsky <kevin.brodsky@arm.com>
To: Will Deacon <will@kernel.org>, Jeff Xu <jeffxu@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org,
anshuman.khandual@arm.com, aruna.ramakrishna@oracle.com,
broonie@kernel.org, catalin.marinas@arm.com,
dave.hansen@linux.intel.com, Dave.Martin@arm.com,
joey.gouly@arm.com, keith.lucas@oracle.com,
pierre.langlois@arm.com, shuah@kernel.org, sroettger@google.com,
tglx@linutronix.de, yury.khrustalev@arm.com,
linux-kselftest@vger.kernel.org, x86@kernel.org,
Kees Cook <keescook@chromium.org>,
Jorge Lucangeli Obes <jorgelo@chromium.org>,
Jann Horn <jannh@google.com>
Subject: Re: [PATCH v3 1/5] arm64: signal: Improve POR_EL0 handling to avoid uaccess failures
Date: Thu, 31 Oct 2024 11:23:56 +0100 [thread overview]
Message-ID: <a3cd71dc-8d83-4c59-a56a-07ed1720473b@arm.com> (raw)
In-Reply-To: <20241031093355.GA7008@willie-the-truck>
On 31/10/2024 10:33, Will Deacon wrote:
> Hi Jeff,
>
> Thanks for chiming in!
>
> On Wed, Oct 30, 2024 at 03:01:53PM -0700, Jeff Xu wrote:
>> On Tue, Oct 29, 2024 at 7:46 AM Kevin Brodsky <kevin.brodsky@arm.com> wrote:
>>> TL;DR: reset POR_EL0 to "allow all" before writing the signal frame,
>>> preventing spurious uaccess failures.
> [...]
>
>>> @@ -924,12 +982,14 @@ SYSCALL_DEFINE0(rt_sigreturn)
>>> if (!access_ok(frame, sizeof (*frame)))
>>> goto badframe;
>>>
>>> - if (restore_sigframe(regs, frame))
>>> + if (restore_sigframe(regs, frame, &ua_state))
>>> goto badframe;
>>>
>>> if (restore_altstack(&frame->uc.uc_stack))
>>> goto badframe;
>>>
>> Do you need to move restore_altstack ahead of restore_sigframe?
>> similar as x86 change [1],
>> the discussion for this happened in [2] [3]
>>
>> [1] https://lore.kernel.org/lkml/20240802061318.2140081-5-aruna.ramakrishna@oracle.com/
>> [2] https://lore.kernel.org/lkml/20240425210540.3265342-1-jeffxu@chromium.org/
>> [3] https://lore.kernel.org/lkml/d0162c76c25bc8e1c876aebe8e243ff2e6862359.camel@intel.com/
>>
>>> + restore_user_access_state(&ua_state);
> The POR isn't restored until here ^^^, so I _think_ restore_altstack()
> is fine where it is. Kevin, can you confirm, please?
Yes, that's correct, see my earlier reply [1].
- Kevin
[1]
https://lore.kernel.org/all/cd0e114d-57eb-4c90-bb6f-9abf0cc8920f@arm.com/
next prev parent reply other threads:[~2024-10-31 10:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 14:45 [PATCH v3 0/5] Improve arm64 pkeys handling in signal delivery Kevin Brodsky
2024-10-29 14:45 ` [PATCH v3 1/5] arm64: signal: Improve POR_EL0 handling to avoid uaccess failures Kevin Brodsky
2024-10-30 22:01 ` Jeff Xu
2024-10-31 8:45 ` Kevin Brodsky
2024-10-31 18:43 ` Jeff Xu
2024-10-31 9:33 ` Will Deacon
2024-10-31 10:23 ` Kevin Brodsky [this message]
2024-10-29 14:45 ` [PATCH v3 2/5] arm64: signal: Remove unnecessary check when saving POE state Kevin Brodsky
2024-10-29 14:45 ` [PATCH v3 3/5] arm64: signal: Remove unused macro Kevin Brodsky
2024-10-29 14:45 ` [PATCH v3 4/5] selftests/mm: Use generic pkey register manipulation Kevin Brodsky
2024-10-29 17:42 ` Dave Hansen
2024-10-29 14:45 ` [PATCH v3 5/5] selftests/mm: Enable pkey_sighandler_tests on arm64 Kevin Brodsky
2024-10-29 18:28 ` [PATCH v3 0/5] Improve arm64 pkeys handling in signal delivery Will Deacon
2024-10-30 21:59 ` Jeff Xu
2024-10-31 13:00 ` Kevin Brodsky
2024-10-31 16:52 ` Jeff Xu
2024-11-04 17:12 ` (subset) " Catalin Marinas
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=a3cd71dc-8d83-4c59-a56a-07ed1720473b@arm.com \
--to=kevin.brodsky@arm.com \
--cc=Dave.Martin@arm.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=aruna.ramakrishna@oracle.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=jannh@google.com \
--cc=jeffxu@chromium.org \
--cc=joey.gouly@arm.com \
--cc=jorgelo@chromium.org \
--cc=keescook@chromium.org \
--cc=keith.lucas@oracle.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pierre.langlois@arm.com \
--cc=shuah@kernel.org \
--cc=sroettger@google.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=yury.khrustalev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox