[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v3 3/4] vsscanf(): do not skip spaces
- To: 'Rasmus Villemoes' <linux@xxxxxxxxxxxxxxxxxx>, Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>, Hans de Goede <hdegoede@xxxxxxxxxx>, "Mauro Carvalho Chehab" <mchehab@xxxxxxxxxx>, Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Lee Jones <lee@xxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Vincenzo Frascino <vincenzo.frascino@xxxxxxx>, Petr Mladek <pmladek@xxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>, "Andy Shevchenko" <andriy.shevchenko@xxxxxxxxxxxxxxx>
- From: David Laight <David.Laight@xxxxxxxxxx>
- Date: Tue, 13 Jun 2023 12:42:59 +0000
- Accept-language: en-GB, en-US
- Cc: "linux-media@xxxxxxxxxxxxxxx" <linux-media@xxxxxxxxxxxxxxx>, "linux-staging@xxxxxxxxxxxxxxx" <linux-staging@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Christoph Hellwig" <hch@xxxxxx>
- Delivery-date: Tue, 13 Jun 2023 12:43:15 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHZnR4ovdHGuD5F0k2o+1T0Ru69aa+Iri8A
- Thread-topic: [PATCH v3 3/4] vsscanf(): do not skip spaces
From: Rasmus Villemoes
> Sent: 12 June 2023 12:08
>
> On 10/06/2023 22.40, Demi Marie Obenour wrote:
> > Passing spaces before e.g. an integer is usually
> > not intended.
>
> Maybe, maybe not. But it's mandated by POSIX/C99.
>
> And of course we are free to ignore that and implement our own semantics
> (though within the constraints that we really want -Wformat to help us),
> but there seems to be existing code in-tree that relies on this
> behavior. For example I think this will break
> fsl_sata_intr_coalescing_store() which uses a scanf format of "%u%u".
>
> Sure, that could just say "%u %u" instead, but the point is that
> currently it doesn't. So without some reasonably thorough analysis
> across the tree, and updates of affected callers, NAK.
It would almost certainly need to be " %u %u" to allow for
userspace generating the input with "%6u %6u",
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT,
UK
Registration No: 1397386 (Wales)
|