Skip to content

Make sscanf() stricter

Demi Marie Obenour linux-media linux-staging lkml xen-devel 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 8 repliesIn review
  2. v23 patches 1 replySuperseded

Changes in v3 from the cover letter

- Better commit messages.
- Fix a compile error in simple_strtoll() (found by 0day bot).
- Fix an uninitialized variable (found by Dan Carpenter).

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4limits.h: add UCHAR_MAX, SCHAR_MAX, and SCHAR_MINdrivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h include/linux/limits.h include/linux/mfd/wl1273-core.h +1 more+4 -43 replies
2/4vsscanf(): Integer overflow is a conversion failurelib/vsprintf.c+69 -211 reply
3/4vsscanf(): do not skip spaceslib/vsprintf.c+1 -73 replies
4/4Reject NUL bytes in xenstore nodesdrivers/xen/xenbus/xenbus_xs.c+12 -50 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchLee Jones
1/4A-b
2/4
3/4
4/4

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

Read the v3 thread

Cover letter [PATCH v3 0/4] Make sscanf() stricter

Roger Pau Monné suggested making xenbus_scanf() stricter instead of using a custom parser. Christoph Hellwig asked why the normal vsscanf() cannot be made stricter. Richard Weinberger mentioned Linus Torvalds’s suggestion of using ! to allow overflow.

Changes since v2:

- Better commit messages.
- Fix a compile error in simple_strtoll() (found by 0day bot).
- Fix an uninitialized variable (found by Dan Carpenter).

Changes since v1:

- Better commit messages.
- Use ! to explicitly opt-in to allowing overflow.
- Treat overflow as a conversion failure instead of returning ERANGE.
- Drop the first patch (removal of simple_strtoll()) as it breaks bcache.
- Stop skipping spaces in vsscanf() instead of adding a separate vsscanf_strict() function.

Demi Marie Obenour (4):
limits.h: add UCHAR_MAX, SCHAR_MAX, and SCHAR_MIN vsscanf(): Integer overflow is a conversion failure vsscanf(): do not skip spaces
Reject NUL bytes in xenstore nodes

 .../hive_isp_css_include/platform_support.h   |  1 -
 drivers/xen/xenbus/xenbus_xs.c                | 17 +++-
 include/linux/limits.h                        |  1 +
 include/linux/mfd/wl1273-core.h               |  3 -
 include/vdso/limits.h                         |  3 +
 lib/vsprintf.c                                | 98 +++++++++++++------
 6 files changed, 86 insertions(+), 37 deletions(-)
Signature · 3 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab