mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-crypto@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] crypto: amcc - fix racy teardown with devm_request_irq
Date: Mon, 10 Aug 2026 18:31:41 +1000	[thread overview]
Message-ID: <anmMbYIYQmkruYSv@gondor.apana.org.au> (raw)
In-Reply-To: <20260730191420.1043871-1-rosenp@gmail.com>

On Thu, Jul 30, 2026 at 12:14:20PM -0700, Rosen Penev wrote:
> The driver uses devm_request_irq() for the IRQ, but cleans up the
> tasklet and DMA rings inside the remove function.  Since devres frees
> the IRQ only after the remove function returns, a window exists where a
> pending hardware interrupt can reschedule the tasklet after it has been
> killed, leading to use-after-free of the descriptor rings.
> 
> Fix by switching to plain request_irq() and adding the corresponding
> free_irq() calls in the remove function and the probe error path before
> tasklet_kill(), ensuring the IRQ is fully torn down before the tasklet
> is killed.
> 
> Rename goto error path to err_tasklet as that's more descriptive.
> 
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  drivers/crypto/amcc/crypto4xx_core.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 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

      reply	other threads:[~2026-08-10  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 19:14 Rosen Penev
2026-08-10  8:31 ` 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=anmMbYIYQmkruYSv@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosenp@gmail.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

all inboxes | Powered by JetHome®