提交 74ac07e8 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: fix race leading to use after free in io_edgeport

usb_unlink_urb() is asynchronous, therefore an URB's buffer may not
be freed without waiting for the completion handler. This patch switches
to usb_kill_urb(), which is synchronous.
Thanks to Alan for making me look at the remaining users of usb_unlink_urb()
Signed-off-by: NOliver Neukum <oneukum@suse.de>
Signed-off-by: NAl Borchers <alborchers@steinerpoint.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 5afeb104
...@@ -3046,11 +3046,11 @@ static void edge_shutdown (struct usb_serial *serial) ...@@ -3046,11 +3046,11 @@ static void edge_shutdown (struct usb_serial *serial)
} }
/* free up our endpoint stuff */ /* free up our endpoint stuff */
if (edge_serial->is_epic) { if (edge_serial->is_epic) {
usb_unlink_urb(edge_serial->interrupt_read_urb); usb_kill_urb(edge_serial->interrupt_read_urb);
usb_free_urb(edge_serial->interrupt_read_urb); usb_free_urb(edge_serial->interrupt_read_urb);
kfree(edge_serial->interrupt_in_buffer); kfree(edge_serial->interrupt_in_buffer);
usb_unlink_urb(edge_serial->read_urb); usb_kill_urb(edge_serial->read_urb);
usb_free_urb(edge_serial->read_urb); usb_free_urb(edge_serial->read_urb);
kfree(edge_serial->bulk_in_buffer); kfree(edge_serial->bulk_in_buffer);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册