Skip to content

usb: Replace {v}snprintf() variants with safer alternatives

Lee Jones linux-arm-kernel linux-usb lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12usb: gadget: configfs: Replace snprintf() with the safer scnprintf() variantdrivers/usb/gadget/configfs.c+7 -40 replies
2/12usb: gadget: f_uac1: Replace snprintf() with the safer scnprintf() variantdrivers/usb/gadget/function/f_uac1.c+3 -30 replies
3/12usb: gadget: f_uac2: Replace snprintf() with the safer scnprintf() variantdrivers/usb/gadget/function/f_uac2.c+3 -30 replies
4/12usb: gadget: uvc: Replace snprintf() with the safer scnprintf() variantdrivers/usb/gadget/function/uvc_configfs.c+1 -11 reply
5/12usb: gadget: udc: atmel: Replace snprintf() with the safer scnprintf() variantdrivers/usb/gadget/udc/atmel_usba_udc.c+1 -20 replies
6/12usb: cdns2: Replace snprintf() with the safer scnprintf() variantdrivers/usb/gadget/udc/cdns2/cdns2-debug.h+69 -690 replies
7/12usb: host: max3421-hcd: Replace snprintf() with the safer scnprintf() variantdrivers/usb/host/max3421-hcd.c+9 -90 replies
8/12usb: yurex: Replace snprintf() with the safer scnprintf() variantdrivers/usb/misc/yurex.c+7 -50 replies
9/12usb: mon_stat: Replace snprintf() with the safer scnprintf() variantdrivers/usb/mon/mon_stat.c+3 -30 replies
10/12usb: mon_text: Replace snprintf() with the safer scnprintf() variantdrivers/usb/mon/mon_text.c+5 -230 replies
11/12usb: phy: twl6030: Remove snprintf() from sysfs call-backs and replace with sysfs_emit()drivers/usb/phy/phy-twl6030-usb.c+4 -40 replies
12/12usb: storage: Remove snprintf() from sysfs call-backs and replace with sysfs_emit()drivers/usb/storage/sierra_ms.c+8 -81 reply

Reviews trailers per patch

2 of 12 patches have a Reviewed-by or Acked-by.

PatchLaurent PinchartAlan Stern
1/12
2/12
3/12
4/12R-b
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] usb: Replace {v}snprintf() variants with safer alternatives

This series is part of an effort to rid {v}snprintf() where possible.

For a far better description of the problem than I could author, see Jon's write-up on LWN [1] and/or Alex's on the Kernel Self Protection Project [1].

[0] https://lwn.net/Articles/69419/
[1] https://github.com/KSPP/linux/issues/105

Lee Jones (12):
usb: gadget: configfs: Replace snprintf() with the safer scnprintf()
variant
usb: gadget: f_uac1: Replace snprintf() with the safer scnprintf()
variant
usb: gadget: f_uac2: Replace snprintf() with the safer scnprintf()
variant
usb: gadget: uvc: Replace snprintf() with the safer scnprintf()
variant
usb: gadget: udc: atmel: Replace snprintf() with the safer scnprintf()
variant
usb: cdns2: Replace snprintf() with the safer scnprintf() variant
usb: host: max3421-hcd: Replace snprintf() with the safer scnprintf()
variant
usb: yurex: Replace snprintf() with the safer scnprintf() variant
usb: mon_stat: Replace snprintf() with the safer scnprintf() variant
usb: mon_text: Replace snprintf() with the safer scnprintf() variant
usb: phy: twl6030: Remove snprintf() from sysfs call-backs and replace
with sysfs_emit()
usb: storage: Remove snprintf() from sysfs call-backs and replace with
sysfs_emit()

 drivers/usb/gadget/configfs.c              |  11 +-
 drivers/usb/gadget/function/f_uac1.c       |   6 +-
 drivers/usb/gadget/function/f_uac2.c       |   6 +-
 drivers/usb/gadget/function/uvc_configfs.c |   2 +-
 drivers/usb/gadget/udc/atmel_usba_udc.c    |   3 +-
 drivers/usb/gadget/udc/cdns2/cdns2-debug.h | 138 ++++++++++-----------
 drivers/usb/host/max3421-hcd.c             |  18 +--
 drivers/usb/misc/yurex.c                   |  12 +-
 drivers/usb/mon/mon_stat.c                 |   6 +-
 drivers/usb/mon/mon_text.c                 |  28 +----
 drivers/usb/phy/phy-twl6030-usb.c          |   8 +-
 drivers/usb/storage/sierra_ms.c            |  16 +--
 12 files changed, 120 insertions(+), 134 deletions(-)
Cc Alan Stern <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Andrzej Pietrasiewicz <[email protected]>
Cc Bryan Wu <[email protected]>
Cc Claudiu Beznea <[email protected]>
Cc Cristian Birsan <[email protected]>
Cc Daniel Scally <[email protected]>
Cc Hema HK <[email protected]>
Cc James Gruber <[email protected]>
Cc Jaswinder Singh <[email protected]>
Cc Julian Scheel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc Ruslan Bilovol <[email protected]>
Cc Tomoki Sekiyama <[email protected]>
Cc Yadwinder Singh <[email protected]>
Signature · 1 line
2.43.0.472.g3155946c3a-goog