lkml.org 
[lkml]   [2017]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] lib/strscpy: avoid KASAN false positive
On Tue, Jul 18, 2017 at 3:04 PM, Andrew Morton
<akpm@linux-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

\
 
 \ /
  Last update: 2017-07-19 00:35    [W:0.034 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site