All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/sme: Set new vector length before reallocating
Date: Wed, 26 Jul 2023 18:37:26 +0100	[thread overview]
Message-ID: <ZMFZ1l6cEc7Qma7O@arm.com> (raw)
In-Reply-To: <20230726-arm64-fix-sme-fix-v1-1-7752ec58af27@kernel.org>

On Wed, Jul 26, 2023 at 01:12:26PM +0100, Mark Brown wrote:
> As part of fixing the allocation of the buffer for SVE state when changing
> SME vector length we introduced an immediate reallocation of the SVE state,
> this is also done when changing the SVE vector length for consistency.
> Unfortunately this reallocation is done prior to writing the new vector
> length to the task struct, meaning the allocation is done with the old
> vector length and can lead to memory corruption due to an undersized buffer
> being used.
> 
> Move the update of the vector length before the allocation to ensure that
> the new vector length is taken into account.
> 
> For some reason this isn't triggering any problems when running tests on
> the arm64 fixes branch (even after repeated tries) but is triggering
> issues very often after merge into mainline.
> 
> Fixes: d4d5be94a878 ("arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>

I'll add a cc stable here since the above commit was fixing code that
went in for 5.19.

-- 
Catalin

  reply	other threads:[~2023-07-26 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26 12:12 [PATCH] arm64/sme: Set new vector length before reallocating Mark Brown
2023-07-26 17:37 ` Catalin Marinas [this message]
2023-07-26 18:45 ` 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=ZMFZ1l6cEc7Qma7O@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=broonie@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.