[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1203211031490.1369-100000@iolanthe.rowland.org>
Date: Wed, 21 Mar 2012 10:35:22 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Ming Lei <tom.leiming@...il.com>
cc: netdev@...r.kernel.org, <linux-usb@...r.kernel.org>,
Fedora Kernel Team <kernel-team@...oraproject.org>,
Dave Jones <davej@...hat.com>
Subject: Re: use-after-free in usbnet
On Wed, 21 Mar 2012, Ming Lei wrote:
> Looks it is a general issue about usb_hcd_unlink_urb.
>
> Alan, how about increasing URB reference count before calling unlink1
> inside usb_hcd_unlink_urb to fix this kind of problem?
No, that won't fix the problem. The URB could complete and be
deallocated even before usb_hcd_unlink_urb() is called, so nothing that
function can do will prevent the error.
It is the caller's responsibility to make sure that the URB does not
get freed before usb_unlink_urb() or usb_kill_urb() returns. We
probably should mention this in the kerneldoc...
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists