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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Feb 2023 11:59:25 +0000
From:   John Keeping <john@...anate.com>
To:     Alan Stern <stern@...land.harvard.edu>
Cc:     Xin Zhao <xnzhao@...gle.com>, gregkh@...uxfoundation.org,
        jakobkoschel@...il.com, rdunlap@...radead.org, ira.weiny@...el.com,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: dummyhcd: Fix use-after-free in
 dummy_free_request

On Mon, Feb 06, 2023 at 07:34:40PM -0500, Alan Stern wrote:
> On Mon, Feb 06, 2023 at 10:52:58PM +0000, Xin Zhao wrote:
> > DummyHCD assume when dummy_free_request is called, the request
> > is already detached from request queues. It is correct in most
> > cases.
> > But when DummyHCD is detached from gadget configfs with pending
> > requests and some requests are still in pending queue,
> > dummy_free_request would free them directly.
> > Later on, dummy_udc_stop would iterate pending queue to release
> > the requests again.
> > 
> > Stacktrace for dummy_free_reqeust
> > ```
> > kfree(const void * x) (slub.c:4200)
> > dummy_free_request(struct usb_ep * _ep, struct usb_request * _req) (dummy_hcd.c:691)
> > usb_ep_free_request(struct usb_ep * ep, struct usb_request * req) (core.c:201)
> > functionfs_unbind(struct ffs_data * ffs) (f_fs.c:1894)
> 
> That's the bug right there.  The kerneldoc for usb_ep_free_request() 
> says "Caller guarantees the request is not queued".  So it looks like 
> the real solution is to fix functionfs_unbind().

This is commit ce405d561b02 ("usb: gadget: f_fs: Ensure ep0req is
dequeued before free_request") IIUC.

Xin, are you able to test a version with that commit?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ