mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] usb: gadget: u_ether: Fix NULL pointer dereferences after gadget unbind
@ 2026-09-23  7:58 Kuen-Han Tsai
  2026-09-23  7:58 ` [PATCH 1/2] usb: gadget: u_ether: Fix NULL pointer deref in debug logging Kuen-Han Tsai
  2026-09-23  7:58 ` [PATCH 2/2] usb: gadget: u_ether: Protect dev->gadget access with dev->lock Kuen-Han Tsai
  0 siblings, 2 replies; 6+ messages in thread
From: Kuen-Han Tsai @ 2026-09-23  7:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ivaylo Dimitrov, Faqiang Zhu, linux-usb, linux-kernel,
	Kuen-Han Tsai, stable

Hi all,

This series fixes two NULL pointer dereference issues in u_ether after
the gadget is unbound and dev->gadget is cleared by
gether_detach_gadget():

- Patch 1 replaces the composite.h DBG()/VDBG()/ERROR()/INFO() macros in
  u_ether.c with netdev_*() helpers so debug logging does not 
  dereference dev->gadget when the net_device is detached from the
  gadget.
- Patch 2 extends dev->lock to serialize dev->gadget accesses across
  eth_get_drvinfo(), rx_submit(), gether_set_gadget(), and
  gether_detach_gadget(), closing a check-then-use race in
  eth_get_drvinfo().

Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
---
Kuen-Han Tsai (2):
      usb: gadget: u_ether: Fix NULL pointer deref in debug logging
      usb: gadget: u_ether: Protect dev->gadget access with dev->lock

 drivers/usb/gadget/function/u_ether.c | 84 ++++++++++++++++++-----------------
 1 file changed, 44 insertions(+), 40 deletions(-)
---
base-commit: abc36cbda29d8f19cf3a580cd86ca9e865186a41
change-id: 20260923-u-ether-gadget-npe-2fddafb37f23

Best regards,
-- 
Kuen-Han Tsai <khtsai@google.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-11  5:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23  7:58 [PATCH 0/2] usb: gadget: u_ether: Fix NULL pointer dereferences after gadget unbind Kuen-Han Tsai
2026-09-23  7:58 ` [PATCH 1/2] usb: gadget: u_ether: Fix NULL pointer deref in debug logging Kuen-Han Tsai
2026-10-10 14:26   ` Aldo Ariel Panzardo
2026-10-11  5:14     ` Greg Kroah-Hartman
2026-09-23  7:58 ` [PATCH 2/2] usb: gadget: u_ether: Protect dev->gadget access with dev->lock Kuen-Han Tsai
2026-10-10 14:27   ` Aldo Ariel Panzardo

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®