From: Jeffin Philip <jeffinphilip14@gmail.com>
To: valentina.manea.m@gmail.com, shuah@kernel.org,
gregkh@linuxfoundation.org
Cc: i@zenithal.me, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
syzbot+af76b01c9a0f0ab60fb0@syzkaller.appspotmail.com,
Jeffin Philip <jeffinphilip14@gmail.com>
Subject: [PATCH v3 2/2] usbip: tools: replace faulty rebind_store with drivers_probe
Date: Tue, 11 Aug 2026 21:35:41 +0530 [thread overview]
Message-ID: <20260811160541.29461-3-jeffinphilip14@gmail.com> (raw)
In-Reply-To: <20260811160541.29461-1-jeffinphilip14@gmail.com>
unbind_device() currently unbinds and then uses rebind_store
to rebind the device back to the usb driver. This is already
possible with the safer drivers_probe rather than the faulty
rebind_store. Fix this by referencing drivers_probe rather
than rebind_store.
Fixes: a46034ca57ed ("staging: usbip: trigger driver probing after unbinding from usbip-host")
Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
---
tools/usb/usbip/src/usbip_unbind.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/usb/usbip/src/usbip_unbind.c b/tools/usb/usbip/src/usbip_unbind.c
index 66a44d4a0d56..242280cec452 100644
--- a/tools/usb/usbip/src/usbip_unbind.c
+++ b/tools/usb/usbip/src/usbip_unbind.c
@@ -34,7 +34,7 @@ static int unbind_device(char *busid)
char unbind_attr_name[] = "unbind";
char unbind_attr_path[SYSFS_PATH_MAX];
- char rebind_attr_name[] = "rebind";
+ char rebind_attr_name[] = "drivers_probe";
char rebind_attr_path[SYSFS_PATH_MAX];
struct udev *udev;
@@ -77,9 +77,8 @@ static int unbind_device(char *busid)
}
/* Trigger new probing. */
- snprintf(rebind_attr_path, sizeof(unbind_attr_path), "%s/%s/%s/%s/%s/%s",
- SYSFS_MNT_PATH, SYSFS_BUS_NAME, bus_type, SYSFS_DRIVERS_NAME,
- USBIP_HOST_DRV_NAME, rebind_attr_name);
+ snprintf(rebind_attr_path, sizeof(rebind_attr_path), "%s/%s/%s/%s",
+ SYSFS_MNT_PATH, SYSFS_BUS_NAME, bus_type, rebind_attr_name);
rc = write_sysfs_attribute(rebind_attr_path, busid, strlen(busid));
if (rc < 0) {
--
2.55.0
next prev parent reply other threads:[~2026-08-11 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 16:05 [PATCH v3 0/2] usbip: usbip_host: remove legacy rebind_store in favor of drivers_probe Jeffin Philip
2026-08-11 16:05 ` [PATCH v3 1/2] usbip: usbip_host: fix null pointer dereference in rebind_store Jeffin Philip
2026-08-11 16:05 ` Jeffin Philip [this message]
2026-08-11 22:53 ` [PATCH v3 0/2] usbip: usbip_host: remove legacy rebind_store in favor of drivers_probe Shuah Khan
2026-08-12 2:40 ` Jeffin Philip
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260811160541.29461-3-jeffinphilip14@gmail.com \
--to=jeffinphilip14@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=i@zenithal.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+af76b01c9a0f0ab60fb0@syzkaller.appspotmail.com \
--cc=valentina.manea.m@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox