USB: io_edgeport: fix use-after-free in TIOCMIWAIT
authorJohan Hovold <jhovold@gmail.com>
Tue, 19 Mar 2013 08:21:16 +0000 (09:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 13:44:24 +0000 (06:44 -0700)
commit25b6e4637943d52412c14093726e3c750e403514
treee468a0649424e5545648c5b470fdb7796f6fe8fe
parent6929b79f07d57ddb86cb9083a5aac6c5f2c7ee0b
USB: io_edgeport: fix use-after-free in TIOCMIWAIT

commit 333576255d4cfc53efd056aad438568184b36af6 upstream.

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/io_edgeport.c