mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Cc: david@ixit.cz, oe-linux-nfc@lists.linux.dev,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] nfc: nxp-nci: fix IRQ use-after-free in i2c remove
Date: Wed, 30 Sep 2026 17:59:36 +0100	[thread overview]
Message-ID: <20260930165936.GY13925@horms.kernel.org> (raw)
In-Reply-To: <20260925175800.3694044-1-qwe.aldo@gmail.com>

On Fri, Sep 25, 2026 at 02:58:00PM -0300, Aldo Ariel Panzardo wrote:
> nxp_nci_i2c_remove() calls nxp_nci_remove() before free_irq().
> nxp_nci_remove() unregisters the NCI device and frees ndev via
> nci_free_device().  The IRQ handler nxp_nci_i2c_irq_thread_fn()
> dereferences phy->ndev and calls nci_get_drvdata() on it; if the
> interrupt fires between the nxp_nci_remove() and free_irq() calls the
> handler operates on freed memory.
> 
> Swap the order: disable the interrupt first with free_irq(), then tear
> down the device.
> 
> Fixes: 6be88670fc59 ("NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>

      reply	other threads:[~2026-09-30 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 17:58 Aldo Ariel Panzardo
2026-09-30 16:59 ` Simon Horman [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=20260930165936.GY13925@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=david@ixit.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oe-linux-nfc@lists.linux.dev \
    --cc=qwe.aldo@gmail.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

all inboxes | Powered by JetHome®