USB: serial: io_edgeport: handle unbound ports on URB completion
authorJohan Hovold <johan@kernel.org>
Fri, 17 Jan 2020 09:50:23 +0000 (10:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:34 +0000 (08:22 +0100)
commit3e8e0296c6f9a939d1214a6878733d0ed187a962
tree88fa1b2a6488f4b21156b287ea8a86a51b4c4462
parent554b03f5ff9c6a9fce4aa71582ae54ebea9b816f
USB: serial: io_edgeport: handle unbound ports on URB completion

commit e37d1aeda737a20b1846a91a3da3f8b0f00cf690 upstream.

Check for NULL port data in the shared interrupt and bulk completion
callbacks to avoid dereferencing a NULL pointer in case a device sends
data for a port device which isn't bound to a driver (e.g. due to a
malicious device having unexpected endpoints or after an allocation
failure on port probe).

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/io_edgeport.c