From: Herbert Xu <herbert@gondor.apana.org.au>
To: Ashish Kalra <Ashish.Kalra@amd.com>
Cc: thomas.lendacky@amd.com, john.allen@amd.com, davem@davemloft.net,
aik@amd.com, dionnaglaze@google.com, michael.roth@amd.com,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [RESEND PATCH v3] crypto: ccp: Fix SNP panic notifier unregistration
Date: Mon, 23 Jun 2025 17:24:49 +0800 [thread overview]
Message-ID: <aFkdYX1tZsESRpne@gondor.apana.org.au> (raw)
In-Reply-To: <20250616215027.68768-1-Ashish.Kalra@amd.com>
On Mon, Jun 16, 2025 at 09:50:27PM +0000, Ashish Kalra wrote:
> From: Ashish Kalra <ashish.kalra@amd.com>
>
> Panic notifiers are invoked with RCU read lock held and when the
> SNP panic notifier tries to unregister itself from the panic
> notifier callback itself it causes a deadlock as notifier
> unregistration does RCU synchronization.
>
> Code flow for SNP panic notifier:
> snp_shutdown_on_panic() ->
> __sev_firmware_shutdown() ->
> __sev_snp_shutdown_locked() ->
> atomic_notifier_chain_unregister(.., &snp_panic_notifier)
>
> Fix SNP panic notifier to unregister itself during SNP shutdown
> only if panic is not in progress.
>
> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: stable@vger.kernel.org
> Fixes: 19860c3274fb ("crypto: ccp - Register SNP panic notifier only if SNP is enabled")
> Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
> ---
> drivers/crypto/ccp/sev-dev.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2025-06-23 9:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 21:50 [RESEND PATCH v3] crypto: ccp: Fix SNP panic notifier unregistration Ashish Kalra
2025-06-23 9:24 ` Herbert Xu [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=aFkdYX1tZsESRpne@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=Ashish.Kalra@amd.com \
--cc=aik@amd.com \
--cc=davem@davemloft.net \
--cc=dionnaglaze@google.com \
--cc=john.allen@amd.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=stable@vger.kernel.org \
--cc=thomas.lendacky@amd.com \
/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