[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwqDxBSKf3u2Uv-90vrhx4WSoQunOPU3witzCAuNhYBhg@mail.gmail.com>
Date: Thu, 25 Jan 2018 09:55:00 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kees Cook <keescook@...omium.org>,
Eryu Guan <eguan@...hat.com>,
Alexander Potapenko <glider@...gle.com>,
Chris Metcalf <metcalf@...m.mit.edu>,
David Laight <David.Laight@...lab.com>,
stable <stable@...r.kernel.org>,
kasan-dev <kasan-dev@...glegroups.com>
Subject: Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.
On Thu, Jan 25, 2018 at 12:32 AM, Dmitry Vyukov <dvyukov@...gle.com> wrote:
> On Wed, Jan 24, 2018 at 6:52 PM, Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
>>
>> So I'd *much* rather have some way to tell KASAN that word-at-a-time
>> is going on. Because that approach definitely makes a difference in
>> other places.
>
> The other option was to use READ_ONCE_NOCHECK().
How about just using the same accessor that we do for the dcache case.
That gives a reasonable example of the whole word-at-a-time model, and
should be good.
COMPLETELY UNTESTED patch attached. This needs to be verified.
It does limit the word-at-a-time code to the architectures that select
both HAVE_EFFICIENT_UNALIGNED_ACCESS and DCACHE_WORD_ACCESS, but that
seems a reasonable choice anyway.
Linus
View attachment "patch.diff" of type "text/plain" (1651 bytes)
Powered by blists - more mailing lists