[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YKa59ovKmBmqzP5F@zeniv-ca.linux.org.uk>
Date: Thu, 20 May 2021 19:35:18 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Petr Mladek <pmladek@...e.com>
Cc: Justin He <Justin.He@....com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Jonathan Corbet <corbet@....net>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Ira Weiny <ira.weiny@...el.com>,
Eric Biggers <ebiggers@...gle.com>,
"Ahmed S. Darwish" <a.darwish@...utronix.de>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-s390 <linux-s390@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 08/14] d_path: make prepend_name() boolean
On Thu, May 20, 2021 at 04:53:38PM +0200, Petr Mladek wrote:
> That said. vsnprintf() returns the number of characters which would
> be generated for the given input. But only the "size" is written.
> This require copying the characters one by one.
Not really - that's more of avoiding trouble if the sucker gets renamed
right under prepend_name(). Note that we have no way to guarantee that
length and string pointer come from the same moment. This looking for
NUL is about protection againts stepping off the end of allocated object.
Powered by blists - more mailing lists