summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2014-03-11 21:26:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-18 00:08:27 +0100
commitaba37fd975f0dd58e025c99c2a79b61b20190831 (patch)
treeaa85fe3f785b0ec9a818834b5466b751a70fa8ce /drivers/usb
parentusb: gadget: f_fs: add missing spinlock and mutex unlock (diff)
downloadlinux-aba37fd975f0dd58e025c99c2a79b61b20190831.tar.xz
linux-aba37fd975f0dd58e025c99c2a79b61b20190831.zip
usb: gadget: tcm_usb_gadget: stop format strings
This makes sure that the name coming out of configfs cannot be used accidentally as a format string. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/tcm_usb_gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c
index 0f8aad78b54f..460c266b8e24 100644
--- a/drivers/usb/gadget/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/tcm_usb_gadget.c
@@ -1613,7 +1613,7 @@ static struct se_wwn *usbg_make_tport(
return ERR_PTR(-ENOMEM);
}
tport->tport_wwpn = wwpn;
- snprintf(tport->tport_name, sizeof(tport->tport_name), wnn_name);
+ snprintf(tport->tport_name, sizeof(tport->tport_name), "%s", wnn_name);
return &tport->tport_wwn;
}