public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org, David Spickett <David.Spickett@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH 6.1.y] arm64/ptrace: Ensure that SME is set up for target when writing SSVE state
Date: Mon, 21 Aug 2023 18:39:50 +0200	[thread overview]
Message-ID: <2023082140-frisbee-flatterer-fd6e@gregkh> (raw)
In-Reply-To: <20230821135834.216609-1-broonie@kernel.org>

On Mon, Aug 21, 2023 at 02:58:33PM +0100, Mark Brown wrote:
> When we use NT_ARM_SSVE to either enable streaming mode or change the
> vector length for a process we do not currently do anything to ensure that
> there is storage allocated for the SME specific register state.  If the
> task had not previously used SME or we changed the vector length then
> the task will not have had TIF_SME set or backing storage for ZA/ZT
> allocated, resulting in inconsistent register sizes when saving state
> and spurious traps which flush the newly set register state.
> 
> We should set TIF_SME to disable traps and ensure that storage is
> allocated for ZA and ZT if it is not already allocated.  This requires
> modifying sme_alloc() to make the flush of any existing register state
> optional so we don't disturb existing state for ZA and ZT.
> 
> Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
> Reported-by: David Spickett <David.Spickett@arm.com>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: <stable@vger.kernel.org> # 5.19.x
> Link: https://lore.kernel.org/r/20230810-arm64-fix-ptrace-race-v1-1-a5361fad2bd6@kernel.org
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> (cherry picked from commit 5d0a8d2fba50e9c07cde4aad7fba28c008b07a5b)
> Signed-off-by: Mark Brown <broonie@kernel.org>

Thanks, now queued up.

greg k-h

      reply	other threads:[~2023-08-21 16:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21 11:27 FAILED: patch "[PATCH] arm64/ptrace: Ensure that SME is set up for target when" failed to apply to 6.1-stable tree gregkh
2023-08-21 13:58 ` [PATCH 6.1.y] arm64/ptrace: Ensure that SME is set up for target when writing SSVE state Mark Brown
2023-08-21 16:39   ` Greg KH [this message]

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=2023082140-frisbee-flatterer-fd6e@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=David.Spickett@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=stable@vger.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