From: Johan Hovold Date: Tue, 19 Mar 2013 08:21:15 +0000 (+0100) Subject: USB: ftdi_sio: fix use-after-free in TIOCMIWAIT X-Git-Tag: v3.9-rc4~11^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71ccb9b01981fabae27d3c98260ea4613207618e;p=pandora-kernel.git USB: ftdi_sio: fix use-after-free in TIOCMIWAIT 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. When switching to tty ports, some lifetime assumptions were changed. Specifically, close can now be called before the final tty reference is dropped as part of hangup at device disconnect. Even with the ftdi private-data refcounting this means that the port private data can be freed while a process is sleeping on modem-status changes and thus cannot be relied on to detect disconnects when woken up. Cc: stable Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed