diff options
author | Kees Cook <keescook@chromium.org> | 2013-07-03 15:04:58 -0700 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:51:23 +0900 |
commit | 0a62b8507fa2b9d277d50eb415dc1c3c21320e53 (patch) | |
tree | 82d83d66b8f01a9eae7f66db66a32d41453218c0 /drivers/usb/atm | |
parent | 9e6d533d0c4d4ae271b87cb81219ac3e2f89f9e0 (diff) | |
download | linux-3.10-0a62b8507fa2b9d277d50eb415dc1c3c21320e53.tar.gz linux-3.10-0a62b8507fa2b9d277d50eb415dc1c3c21320e53.tar.bz2 linux-3.10-0a62b8507fa2b9d277d50eb415dc1c3c21320e53.zip |
upstream: drivers: avoid parsing names as kthread_run() format strings
Calling kthread_run with a single name parameter causes it to be handled
as a format string. Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r-- | drivers/usb/atm/usbatm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index d3527dd8b90..5e0d33a7da5 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -1020,7 +1020,7 @@ static int usbatm_heavy_init(struct usbatm_data *instance) { struct task_struct *t; - t = kthread_create(usbatm_do_heavy_init, instance, + t = kthread_create(usbatm_do_heavy_init, instance, "%s", instance->driver->driver_name); if (IS_ERR(t)) { usb_err(instance, "%s: failed to create kernel_thread (%ld)!\n", @@ -1076,7 +1076,8 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, /* public fields */ instance->driver = driver; - snprintf(instance->driver_name, sizeof(instance->driver_name), driver->driver_name); + strlcpy(instance->driver_name, driver->driver_name, + sizeof(instance->driver_name)); instance->usb_dev = usb_dev; instance->usb_intf = intf; |