lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Aug 2020 21:10:43 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Josef Bacik' <josef@...icpanda.com>,
        Al Viro <viro@...iv.linux.org.uk>,
        Christoph Hellwig <hch@....de>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "kernel-team@...com" <kernel-team@...com>,
        "willy@...radead.org" <willy@...radead.org>
Subject: RE: [PATCH][v2] proc: use vmalloc for our kernel buffer

From: Josef Bacik
> Sent: 13 August 2020 18:19
...
> We wouldn't even need the extra +1 part, since we're only copying in how much
> the user wants anyway, we could just go ahead and convert this to
> 
> left -= snprintf(buffer, left, "0x%04x\n", *(unsigned int *) table->data);
> 
> and be fine, right?  Or am I misunderstanding what you're looking for?  Thanks,

Doesn't that need to be scnprintf()?
IIRC snprintf() returns the number of bytes that would have been
written were the buffer infinite size?
(I suspect this is an 'accidental' return value from the original
SYSV? userspace implementation that just dumped characters that
wouldn't fit in the buffer somewhere.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists