linux/drivers/usb
Lee Jones b385ef088c usb: cdnsp: Replace snprintf() with the safer scnprintf() variant
There is a general misunderstanding amongst engineers that {v}snprintf()
returns the length of the data *actually* encoded into the destination
array.  However, as per the C99 standard {v}snprintf() really returns
the length of the data that *would have been* written if there were
enough space for it.  This misunderstanding has led to buffer-overruns
in the past.  It's generally considered safer to use the {v}scnprintf()
variants in their place (or even sprintf() in simple cases).  So let's
do that.

The uses in this file all seem to assume that data *has been* written!

Link: https://lwn.net/Articles/69419/
Link: https://github.com/KSPP/linux/issues/105
Cc: Pawel Laszczak <pawell@cadence.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20231130105459.3208986-3-lee@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-04 22:25:17 +09:00
..
atm usb: atm: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2023-12-04 22:25:16 +09:00
c67x00 USB: c67x00: Remove unused declaration c67x00_hcd_msg_received() 2023-10-02 16:42:33 +02:00
cdns3 usb: cdnsp: Replace snprintf() with the safer scnprintf() variant 2023-12-04 22:25:17 +09:00
chipidea usb: chipidea: udc: Add revision check of 2.20[CI_REVISION_22] 2023-11-22 12:02:53 +00:00
class TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
common Merge 6.5-rc6 into usb-next 2023-08-14 22:22:31 +02:00
core Merge 6.7-rc3 into usb-next 2023-11-27 09:23:49 +00:00
dwc2 USB: dwc2: write HCINT with INTMASK applied 2023-11-21 15:30:27 +01:00
dwc3 USB: dwc3: qcom: fix ACPI platform device leak 2023-11-22 12:14:36 +00:00
early usb: early: xhci-dbc: Use memcpy_and_pad() 2023-01-31 10:40:54 +01:00
fotg210 usb: fotg210: Convert to platform remove callback returning void 2023-05-28 12:36:25 +01:00
gadget usb:gadget:uvc Do not use worker thread to pump isoc usb requests 2023-11-23 12:32:44 +00:00
host xhci: fix possible null pointer deref during xhci urb enqueue 2023-12-04 07:50:40 +01:00
image scsi: usb: uas: Declare two host templates and host template pointers const 2023-03-24 19:20:00 -04:00
isp1760 usb: isp1760: Convert to platform remove callback returning void 2023-05-28 12:38:01 +01:00
misc usb: misc: onboard_usb_hub: Add support for Cypress CY7C6563x 2023-11-27 19:13:22 +00:00
mon usbmon: Use list_for_each_entry() helper 2023-10-02 16:19:01 +02:00
mtu3 usb: mtu3: Convert to platform remove callback returning void 2023-10-21 12:49:08 +02:00
musb Merge 6.6-rc6 into usb-next 2023-10-16 17:36:12 +02:00
phy usb: phy: generic: add suspend support for regulator 2023-11-23 12:32:43 +00:00
renesas_usbhs usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
roles USB: roles: make role_class a static const structure 2023-06-20 16:20:40 +02:00
serial USB: serial: option: add Luat Air72*U series products 2023-11-23 18:39:30 +01:00
storage usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility 2023-10-28 12:23:41 +02:00
typec Merge 6.7-rc3 into usb-next 2023-11-27 09:23:49 +00:00
usbip USB: usbip: vudc: Convert to platform remove callback returning void 2023-11-22 12:02:53 +00:00
Kconfig usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk 2023-10-02 16:19:12 +02:00
Makefile usb: host: u132-hcd: Delete driver 2023-03-21 14:06:11 +01:00
usb-skeleton.c