Patch "usbip: keep usbip_device sockfd state in sync with tcp_socket" has been added to the 4.14-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usbip: keep usbip_device sockfd state in sync with tcp_socket
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
usbip-keep-usbip_device-sockfd-state-in-sync-with-tcp_socket.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
009f41aed4b3e11e6dc1e3c07377a10c20f1a5edMon Sep 17 00:00:00 2001
From: Shuah Khan <[email protected]>
Date: Fri, 26 Jan 2018 11:56:50 -0700
Subject: usbip: keep usbip_device sockfd state in sync with tcp_socket
From: Shuah Khan <[email protected]>
commit 009f41aed4b3e11e6dc1e3c07377a10c20f1a5ed upstream.
Keep usbip_device sockfd state in sync with tcp_socket. When tcp_socket is reset to null, reset sockfd to -1 to keep it in sync.
--- drivers/usb/usbip/stub_dev.c | 3 +++ drivers/usb/usbip/vhci_hcd.c | 2 ++ 2 files changed, 5 insertions(+)
drivers/usb/usbip/stub_dev.c +3 -0
@@ -87,6 +87,7 @@ static ssize_t store_sockfd(struct devic goto err; sdev->ud.tcp_socket = socket; + sdev->ud.sockfd = sockfd;spin_unlock_irq (&sdev->ud.lock);
@@ -186,6 +187,7 @@ static void stub_shutdown_connection(strif (ud->tcp_socket) {sockfd_put (ud->tcp_socket); ud->tcp_socket =NULL ; + ud->sockfd =-1 ; }/* 3. free used data */
@@ -280,6 +282,7 @@ static struct stub_device *stub_device_a sdev->ud.status =SDEV_ST_AVAILABLE ;spin_lock_init (&sdev->ud.lock); sdev->ud.tcp_socket =NULL ; + sdev->ud.sockfd =-1 ;INIT_LIST_HEAD (&sdev->priv_init);INIT_LIST_HEAD (&sdev->priv_tx);
drivers/usb/usbip/vhci_hcd.c +2 -0
@@ -998,6 +998,7 @@ static void vhci_shutdown_connection(strif (vdev->ud.tcp_socket) {sockfd_put (vdev->ud.tcp_socket); vdev->ud.tcp_socket =NULL ; + vdev->ud.sockfd =-1 ; }pr_info ("release socket\n" );
@@ -1044,6 +1045,7 @@ static void vhci_device_reset(struct usbif (ud->tcp_socket) {sockfd_put (ud->tcp_socket); ud->tcp_socket =NULL ; + ud->sockfd =-1 ; } ud->status =VDEV_ST_NULL ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/usbip-keep-usbip_device-sockfd-state-in-sync-with-tcp_socket.patch