[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1518322806.418920876@decadent.org.uk>
Date: Sun, 11 Feb 2018 04:20:06 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Alan" <gnomes@...rguk.ukuu.org.uk>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Alan Cox" <alan@...ux.intel.com>
Subject: [PATCH 3.2 71/79] usbip: Fix sscanf handling
3.2.99-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alan <gnomes@...rguk.ukuu.org.uk>
commit 2d32927127f44d755780aa5fa88c8c34e72558f8 upstream.
Scan only to the length permitted by the buffer
One of a set of sscanf problems noted by Jackie Chang
Signed-off-by: Alan Cox <alan@...ux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/staging/usbip/userspace/libsrc/usbip_common.c | 2 +-
drivers/staging/usbip/userspace/libsrc/vhci_driver.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/staging/usbip/userspace/libsrc/usbip_common.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_common.c
@@ -164,7 +164,7 @@ int read_attr_speed(struct sysfs_device
goto err;
}
- ret = sscanf(attr->value, "%s\n", speed);
+ ret = sscanf(attr->value, "%99s\n", speed);
if (ret < 1) {
dbg("sscanf failed");
goto err;
--- a/drivers/staging/usbip/userspace/libsrc/vhci_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/vhci_driver.c
@@ -66,7 +66,7 @@ static int parse_status(char *value)
unsigned long socket;
char lbusid[SYSFS_BUS_ID_SIZE];
- ret = sscanf(c, "%d %d %d %x %lx %s\n",
+ ret = sscanf(c, "%d %d %d %x %lx %31s\n",
&port, &status, &speed,
&devid, &socket, lbusid);
Powered by blists - more mailing lists