From: David Engraf <david.engraf@sysgo.com>
To: Mark Brown <broonie@kernel.org>
Cc: suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org,
mark.rutland@arm.com, elver@google.com, ebiederm@xmission.com,
seanjc@google.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: signal: nofpsimd: Do not allocate fp/simd context when not available
Date: Mon, 28 Feb 2022 08:56:49 +0100 [thread overview]
Message-ID: <4d02e8f6-2809-110d-408d-b379f9c9390c@sysgo.com> (raw)
In-Reply-To: <YhkYbhxA8+IQxVcb@sirena.org.uk>
On 25.02.22 18:57, Mark Brown wrote:
> On Fri, Feb 25, 2022 at 11:40:08AM +0100, David Engraf wrote:
>> Commit 6d502b6ba1b2 ("arm64: signal: nofpsimd: Handle fp/simd context for
>> signal frames") introduced saving the fp/simd context for signal handling
>> only when support is available. But setup_sigframe_layout() always
>> reserves memory for fp/simd context. The additional memory is not touched
>> because preserve_fpsimd_context() is not called and thus the magic is
>> invalid.
>>
>> This may lead to an error when parse_user_sigframe() checks the fp/simd
>> area and does not find a valid magic number.
>
> How did you spot this - do you have a system that can reproduce this?
> It'd be good to have coverage if there's testing but there's no easily
> obtainable userspace that I'm aware of.
I'm using a hypervisor which reports no fp/simd support. The user space
was a busybox with init and shell. The shell gets a SIGSEGV because
parse_user_sigframe() returns -EINVAL (bad magic).
user->sigframe in get_sigframe() uses the user stack pointer and the
area was not zeroed. Thus the magic at fpsimd_offset is invalid.
Best regards
- David
next prev parent reply other threads:[~2022-02-28 7:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 10:40 David Engraf
2022-02-25 17:57 ` Mark Brown
2022-02-28 7:56 ` David Engraf [this message]
2022-02-28 13:20 ` Mark Brown
2022-02-28 18:34 ` Catalin Marinas
2022-03-07 22:03 ` Will Deacon
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=4d02e8f6-2809-110d-408d-b379f9c9390c@sysgo.com \
--to=david.engraf@sysgo.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=ebiederm@xmission.com \
--cc=elver@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=seanjc@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.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
all inboxes | Powered by JetHome®