public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 0/4] Make sscanf() stricter
@ 2023-06-12 11:59 Alexey Dobriyan
  2023-06-12 20:25 ` Demi Marie Obenour
  0 siblings, 1 reply; 20+ messages in thread
From: Alexey Dobriyan @ 2023-06-12 11:59 UTC (permalink / raw)
  To: Demi Marie Obenour
  Cc: linux-kernel, Rasmus Villemoes, Hans de Goede,
	Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman,
	Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
	Lee Jones, Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino,
	Petr Mladek, Steven Rostedt, Sergey Senozhatsky, Andy Shevchenko

> +	bool _placeholder;
> +	return simple_strntoull(cp, INT_MAX, endp, base, &_placeholder);

This can be done without introducing dummy variables:

	void f(bool *b)
	{
	}

	f((bool[1]){});

> > lib/vsprintf.c:3727:26: error: unknown conversion type character ‘!’ in format [-Werror=format=]
> So NAK.

Yeah, ! should go after format specifier like it does for %p.

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH v3 0/4] Make sscanf() stricter
@ 2023-06-10 20:40 Demi Marie Obenour
  2023-06-12 15:34 ` Andy Shevchenko
  0 siblings, 1 reply; 20+ messages in thread
From: Demi Marie Obenour @ 2023-06-10 20:40 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Juergen Gross, Stefano Stabellini,
	Oleksandr Tyshchenko, Lee Jones, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Petr Mladek, Steven Rostedt,
	Sergey Senozhatsky, Andy Shevchenko, Rasmus Villemoes
  Cc: Demi Marie Obenour, linux-media, linux-staging, linux-kernel,
	xen-devel

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(-)

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-06-21  0:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-12 11:59 [PATCH v3 0/4] Make sscanf() stricter Alexey Dobriyan
2023-06-12 20:25 ` Demi Marie Obenour
2023-06-12 21:00   ` Andy Shevchenko
2023-06-12 21:23     ` Demi Marie Obenour
2023-06-12 22:16       ` Andy Shevchenko
2023-06-13 13:02       ` David Laight
2023-06-13 15:35         ` Demi Marie Obenour
2023-06-14  8:23           ` David Laight
2023-06-14 20:08             ` Demi Marie Obenour
2023-06-15  8:06               ` David Laight
2023-06-15 11:23                 ` Andy Shevchenko
2023-06-15 11:38                   ` David Laight
2023-06-20 13:34                   ` Petr Mladek
2023-06-20 13:52                     ` Andy Shevchenko
2023-06-20 13:54                       ` Andy Shevchenko
2023-06-20 14:57                       ` Petr Mladek
2023-06-20 15:05                         ` Andy Shevchenko
2023-06-21  0:56                     ` Demi Marie Obenour
  -- strict thread matches above, loose matches on Subject: below --
2023-06-10 20:40 Demi Marie Obenour
2023-06-12 15:34 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox