From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: David Laight <David.Laight@ACULAB.COM>,
Kees Cook <keescook@chromium.org>,
Dmitry Vyukov <dvyukov@google.com>
Cc: Eryu Guan <eguan@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Chris Metcalf <cmetcalf@ezchip.com>,
Alexander Potapenko <glider@google.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] lib/string: avoid reading beyond src buffer in strscpy
Date: Tue, 12 Dec 2017 19:06:12 +0300 [thread overview]
Message-ID: <a67a79a6-5397-abc2-f222-bb4cb62ee6e3@virtuozzo.com> (raw)
In-Reply-To: <2a9ca72e28ba44198f07f4e412970ad9@AcuMS.aculab.com>
On 12/12/2017 01:19 PM, David Laight wrote:
> From: Andrey Ryabinin
>> Sent: 11 December 2017 16:44
> ...
>> I suppose that depends on which one strscpy() caller you'd want to test.
>> Briefly looking at all current users, it doesn't look like they process huge amounts
>> of data through strscpy(), thus we shouldn't suffer from a slight
>> performance degradation of strscpy().
>
> Don't most of the fast string functions use the same kind of
> optimisations.
> strlen() is very likely to do 64 bit reads and then shifts (etc)
> to determine whether any of the bytes are zero.
>
See for yourself, strscpy() is the only sting function doing this.
> David
>
next prev parent reply other threads:[~2017-12-12 16:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 11:33 Eryu Guan
2017-12-07 18:26 ` Kees Cook
2017-12-08 15:29 ` Andrey Ryabinin
2017-12-08 15:29 ` Dmitry Vyukov
2017-12-08 20:54 ` Kees Cook
2017-12-11 16:44 ` Andrey Ryabinin
2017-12-12 10:19 ` David Laight
2017-12-12 16:06 ` Andrey Ryabinin [this message]
2017-12-12 22:42 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a67a79a6-5397-abc2-f222-bb4cb62ee6e3@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=David.Laight@ACULAB.COM \
--cc=akpm@linux-foundation.org \
--cc=cmetcalf@ezchip.com \
--cc=dvyukov@google.com \
--cc=eguan@redhat.com \
--cc=glider@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®