Linux USB
 help / color / mirror / Atom feed
* [PATCH v4 0/2] usb: gadget: use after free in dev_config
@ 2021-12-31 17:21 Hangyu Hua
  2021-12-31 17:21 ` [PATCH v4 1/2] usb: gadget: don't release an existing dev->buf Hangyu Hua
  2021-12-31 17:21 ` [PATCH v4 2/2] usb: gadget: clear related members when goto fail Hangyu Hua
  0 siblings, 2 replies; 5+ messages in thread
From: Hangyu Hua @ 2021-12-31 17:21 UTC (permalink / raw)
  To: balbi, gregkh, axboe, dan.carpenter, jj251510319013, stern
  Cc: linux-usb, linux-kernel, Hangyu Hua

There are two bugs:
dev->buf does not need to be released if it already exists before
executing dev_config.
dev->config and dev->hs_config and dev->dev need to be cleaned if
dev_config fails to avoid UAF.

v2:
1. break one patch up into two separate patches.
2. use "fail:" to clear all members.

v3:
fix a mistake in [PATCH v3 2/2]

v4:
avoid multiple unnecessary statement labels in [PATCH v4 2/2]

Hangyu Hua (2):
  usb: gadget: don't release an existing dev->buf
  usb: gadget: clear related members when goto fail

 drivers/usb/gadget/legacy/inode.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-12-31 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-31 17:21 [PATCH v4 0/2] usb: gadget: use after free in dev_config Hangyu Hua
2021-12-31 17:21 ` [PATCH v4 1/2] usb: gadget: don't release an existing dev->buf Hangyu Hua
2021-12-31 17:34   ` Alan Stern
2021-12-31 17:21 ` [PATCH v4 2/2] usb: gadget: clear related members when goto fail Hangyu Hua
2021-12-31 17:35   ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox