[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190820201515.GA20068@kroah.com>
Date: Tue, 20 Aug 2019 13:15:15 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Mark Salyzyn <salyzyn@...roid.com>
Cc: linux-kernel@...r.kernel.org, kernel-team@...roid.com,
"Yavuz, Tuba" <tuba@....ufl.edu>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
stable <stable@...r.kernel.org>, Felipe Balbi <balbi@...com>,
linux-usb@...r.kernel.org
Subject: Re: USB: gadget: f_midi: fixing a possible double-free in f_midi
On Tue, Aug 20, 2019 at 10:45:13AM -0700, Mark Salyzyn wrote:
> From: "Yavuz, Tuba" <tuba@....ufl.edu>
>
> cherry pick from commit 7fafcfdf6377b18b2a726ea554d6e593ba44349f
> ("USB: gadget: f_midi: fixing a possible double-free in f_midi")
> Removing 'return err;' from conflict.
>
> It looks like there is a possibility of a double-free vulnerability on an
> error path of the f_midi_set_alt function in the f_midi driver. If the
> path is feasible then free_ep_req gets called twice:
>
> req->complete = f_midi_complete;
> err = usb_ep_queue(midi->out_ep, req, GFP_ATOMIC);
> => ...
> usb_gadget_giveback_request
> =>
> f_midi_complete (CALLBACK)
> (inside f_midi_complete, for various cases of status)
> free_ep_req(ep, req); // first kfree
> if (err) {
> ERROR(midi, "%s: couldn't enqueue request: %d\n",
> midi->out_ep->name, err);
> free_ep_req(midi->out_ep, req); // second kfree
> return err;
> }
>
> The double-free possibility was introduced with commit ad0d1a058eac
> ("usb: gadget: f_midi: fix leak on failed to enqueue out requests").
>
> Found by MOXCAFE tool.
>
> Signed-off-by: Tuba Yavuz <tuba@....ufl.edu>
> Fixes: ad0d1a058eac ("usb: gadget: f_midi: fix leak on failed to enqueue out requests")
> Acked-by: Felipe Balbi <felipe.balbi@...ux.intel.com>
> Cc: stable <stable@...r.kernel.org> # 4.4.y
No signed-off-by from you?
Anyway, this is already in the 4.4.y queue and will be in the next
release.
thanks,
greg k-h
Powered by blists - more mailing lists