public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] usb: gadget: use after free in dev_config
@ 2021-12-30  4:38 Hangyu Hua
  2021-12-30  4:38 ` [PATCH v2 1/2] usb: gadget: don't release an existing dev->buf Hangyu Hua
  2021-12-30  4:38 ` [PATCH v2 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-30  4:38 UTC (permalink / raw)
  To: balbi, gregkh, axboe, stern, jj251510319013, dan.carpenter
  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.

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 | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

-- 
2.25.1


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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-30  4:38 [PATCH v2 0/2] usb: gadget: use after free in dev_config Hangyu Hua
2021-12-30  4:38 ` [PATCH v2 1/2] usb: gadget: don't release an existing dev->buf Hangyu Hua
2021-12-30 11:03   ` Greg KH
2021-12-31  1:44     ` Hangyu Hua
2021-12-30  4:38 ` [PATCH v2 2/2] usb: gadget: clear related members when goto fail Hangyu Hua

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