lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Dec 2021 16:11:52 -0500
From:   Alan Stern <stern@...land.harvard.edu>
To:     Hangyu Hua <hbh25y@...il.com>
Cc:     balbi@...nel.org, gregkh@...uxfoundation.org, axboe@...nel.dk,
        dan.carpenter@...cle.com, jj251510319013@...il.com,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: use after free in dev_config

On Tue, Dec 28, 2021 at 05:21:26PM +0800, Hangyu Hua wrote:
> There are two bugs:

You should break this up into two separate patches, one for each bug.

> dev->buf does not need to be released if it already exists before
> executing dev_config.

That's right.  The call to dev_config should fail without changing any 
of the stored values.

> dev->config and dev->hs_config and dev->dev need to be cleaned if
> dev_config fails to avoid UAF.

Do they really need to be cleared?  I think if dev_config fails then 
those pointers never get used, so it doesn't matter what they contain.

Of course, clearing them doesn't hurt, but it would be best to clear 
all of them in the "fail:" part of the routine.  And then you would 
want to change the pathway where usb_gadget_probe_driver fails, to make 
it go to "fail:" also.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ