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: Thu, 18 May 2023 10:52:31 +0900 [thread overview]
Message-ID: <ZGWE36pSRMsIHCCa@finisterre.sirena.org.uk> (raw)
In-Reply-To: <2d9a04d8-c09e-49aa-95eb-32b4679f7eba@kili.mountain>
[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]
On Wed, May 17, 2023 at 10:30:29PM +0300, Dan Carpenter wrote:
> I don't know this code at all so probably this is dumb... I don't
> undestand how vec_set_vector_length() ensures that sme_state_size()
> stays in sync with the actual size allocated in sme_alloc()
> 866 vl = find_supported_vector_length(type, vl);
> type is ARM64_VEC_SVE. I've looked at this function for a while and
> I don't see anything which ensures that "vl" is less than the current
> value.
It could be either ARM64_VEC_SVE or ARM64_VEC_SME.
> 917 task_set_vl(task, type, vl);
> "vl" is set here. This is fine if we are setting it to a smaller value,
> but if we are setting it to a larger value then I think we need to
> realloc the ->sme_state buffer.
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-05-18 1:53 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 [this message]
2023-05-22 15:40 ` Dan Carpenter
2023-05-23 10:28 ` Mark Brown
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=ZGWE36pSRMsIHCCa@finisterre.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®