OSDN Git Service

usbip: prevent vhci_hcd driver from leaking a socket pointer address
authorShuah Khan <shuahkh@osg.samsung.com>
Thu, 7 Dec 2017 21:16:49 +0000 (14:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 11:55:50 +0000 (12:55 +0100)
commitce601a07bc504b4748f8e7a34896684f79514e51
treecd0250d8d8353fec6917f4ef840344beb96361e3
parent5c26ee198fcacda157918a9b211ba1f111e1ed9b
usbip: prevent vhci_hcd driver from leaking a socket pointer address

commit 2f2d0088eb93db5c649d2a5e34a3800a8a935fc5 upstream.

When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the

/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.

Fix it to not leak. The socket pointer address is not used at the moment
and it was made visible as a convenient way to find IP address from socket
pointer address by looking up /proc/net/{tcp,tcp6}.

As this opens a security hole, the fix replaces socket pointer address with
sockfd.

Reported-by: Secunia Research <vuln@secunia.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/usbip_common.h
drivers/usb/usbip/vhci_sysfs.c
tools/usb/usbip/libsrc/vhci_driver.c