[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzkdnXTdonSMAH6rY_oJAEnJ4FQULXvHuOaUpx2JpmPpA@mail.gmail.com>
Date: Tue, 18 Jul 2017 15:35:21 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>,
Dave Jones <davej@...emonkey.org.uk>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Chris Metcalf <cmetcalf@...hip.com>
Subject: Re: [PATCH] lib/strscpy: avoid KASAN false positive
On Tue, Jul 18, 2017 at 3:04 PM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
>
> We could just remove all that word-at-a-time logic. Do we have any
> evidence that this would harm anything?
One option would be to simply make reads more permissive, and only
check the first byte of the read (unlike the last, which is what it
does now). Obviously within the normal KASAN granularity level (which
I think is 8 byte aligned anyway).
Checking *writes* more carefully is obviously a good idea regardless.
But the whole "do big reads" is pretty common for a lot of memory and
string copies.
So maybe the whole KASAN_SHADOW_MASK thing could be limited to just
the write side?
That would certainly simplify things. How much it would hurt coverage
would be something that the people who have analyzed KASAN reports so
far would have to judge. Have any of the existing KASAN reports been
due to the KASAN_SHADOW_SCALE level read tests?
Linus
Powered by blists - more mailing lists