mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: hyunjungg <hj351016@gmail.com>
Cc: Ray Jui <ray.jui@broadcom.com>,
	 Florian Fainelli <florian.fainelli@broadcom.com>,
	 Raviteja Garimella <raviteja.garimella@broadcom.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	 Kishon Vijay Abraham I <kishon@kernel.org>,
	 Manivannan Sadhasivam <mani@kernel.org>,
	 bcm-kernel-feedback-list@broadcom.com,
	linux-phy@lists.infradead.org,  linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] phy: phy-bcm-ns2-usbdrd: cancel extcon work on unbind to avoid use-after-free
Date: Fri, 13 Nov 2026 19:10:36 +0530	[thread overview]
Message-ID: <179457723606.636098.6675726002332403998.b4-ty@kernel.org> (raw)
In-Reply-To: <20261109170223.1829473-1-hj351016@gmail.com>


On Tue, 10 Nov 2026 02:02:23 +0900, hyunjungg wrote:
> ns2_drd_phy_probe() schedules driver->wq_extcon (extcon_work), which is
> also queued from the ID/VBUS GPIO interrupt handler gpio_irq_handler().
> The work handler dereferences the driver data via container_of().
> 
> struct ns2_phy_driver is allocated with devm_kzalloc() and the driver has
> no remove callback, so on unbind devres frees it after probe's resources
> are released. The GPIO interrupts are requested with devm_request_irq(),
> and so released by devres; free_irq() only stops further interrupts, it
> does not cancel a delayed work that is already queued. probe() queues
> wq_extcon with a debounce delay before returning, and the GPIO interrupt
> can queue it too, so on unbind the pending work can run after
> ns2_phy_driver has been freed, dereferencing freed memory (use-after-free).
> 
> [...]

Applied, thanks!

[1/1] phy: phy-bcm-ns2-usbdrd: cancel extcon work on unbind to avoid use-after-free
      commit: 7a14efb16083531e442de4c7897bce74ac8635e8

Best regards,
-- 
~Vinod



      parent reply	other threads:[~2026-11-13 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 17:02 hyunjungg
2026-11-09 17:13 ` Ray Jui
2026-11-10 17:52 ` Florian Fainelli
2026-11-13 13:40 ` Vinod Koul [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=179457723606.636098.6675726002332403998.b4-ty@kernel.org \
    --to=vkoul@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hj351016@gmail.com \
    --cc=kishon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=raviteja.garimella@broadcom.com \
    --cc=ray.jui@broadcom.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®