From: Mark Brown <broonie@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
linux-stable <stable@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
lkft-triage@lists.linaro.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Shuah Khan <shuah@kernel.org>,
Anders Roxell <anders.roxell@linaro.org>
Subject: Re: arm64: fp-stress: BUG: KFENCE: memory corruption in fpsimd_release_task
Date: Tue, 23 May 2023 11:28:14 +0100 [thread overview]
Message-ID: <99c3fac1-e964-4cf6-ba14-58de305aa37d@sirena.org.uk> (raw)
In-Reply-To: <43d53046-f8d9-4c4a-90ba-709910a13f97@kili.mountain>
[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]
On Mon, May 22, 2023 at 06:40:59PM +0300, Dan Carpenter wrote:
> On Thu, May 18, 2023 at 10:52:31AM +0900, Mark Brown wrote:
> > > When we call sme_alloc() it will say the buffer is already allocated
> > > and just zero out what we need for "vl", but the existing buffer is too
> > > small.
> > If we are setting the SVE vector length we do not need to reallocate the
> > SME state since the size of the data stored in the sme_state buffer is
> > influenced only by the SME vector length, not the SVE vector length. We
> > unconditionally free the SVE state (causing it to be reallocated when
> > needed) since the size needed for it depends on both vector lengths.
> arch/arm64/kernel/fpsimd.c
> 909 /*
> 910 * Force reallocation of task SVE and SME state to the correct
> 911 * size on next use:
> 912 */
> 913 sve_free(task);
> Sure, this forces a reallocation. But what prevents it from happening
> before we reach the task_set_vl() line?
Reallocation is either triggered by a trap from userspace or via ptrace,
as is a vector length configuration. The two cases should already be
prevented from running simultaneously, and can't simultaneously perform
two actions.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-05-23 10:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 6:28 Naresh Kamboju
2023-05-16 13:44 ` Will Deacon
2023-05-16 14:45 ` Mark Brown
2023-05-22 16:41 ` Will Deacon
2023-05-23 10:49 ` Mark Brown
2023-05-25 13:35 ` Naresh Kamboju
2023-05-25 13:19 ` Naresh Kamboju
2023-05-25 13:47 ` Mark Brown
2023-05-17 19:30 ` Dan Carpenter
2023-05-18 1:52 ` Mark Brown
2023-05-22 15:40 ` Dan Carpenter
2023-05-23 10:28 ` Mark Brown [this message]
2023-05-22 22:12 ` Mark Brown
2023-05-25 13:51 ` Naresh Kamboju
2023-06-26 14:41 ` Will Deacon
2023-06-26 17:53 ` Daniel Díaz
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=99c3fac1-e964-4cf6-ba14-58de305aa37d@sirena.org.uk \
--to=broonie@kernel.org \
--cc=anders.roxell@linaro.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lkft-triage@lists.linaro.org \
--cc=naresh.kamboju@linaro.org \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--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®