[lkml]   [2019]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] kasan: Remove use after scope bugs detection.
On 1/14/19 4:24 PM, Dmitry Vyukov wrote:
> On Fri, Jan 11, 2019 at 7:58 PM Andrey Ryabinin <> wrote:
>> Use after scope bugs detector seems to be almost entirely useless
>> for the linux kernel. It exists over two years, but I've seen only
>> one valid bug so far [1]. And the bug was fixed before it has been
>> reported. There were some other use-after-scope reports, but they
>> were false-positives due to different reasons like incompatibility
>> with structleak plugin.
>> This feature significantly increases stack usage, especially with
>> GCC < 9 version, and causes a 32K stack overflow. It probably
>> adds performance penalty too.
>> Given all that, let's remove use-after-scope detector entirely.
>> While preparing this patch I've noticed that we mistakenly enable
>> use-after-scope detection for clang compiler regardless of
>> CONFIG_KASAN_EXTRA setting. This is also fixed now.
> Hi Andrey,
> I am on a fence. On one hand removing bug detection sucks and each
> case of a missed memory corruption leads to a splash of assorted bug
> reports by syzbot. On the other hand everything you said is true.
> Maybe support for CONFIG_VMAP_STACK will enable stacks larger then

Yes, with vmap stacks higher order won't be a problem, since vmalloc() does only 0-order
allocations. But even with vmap stacks use-after-scope won't become useful,
thus I don't see the point of re-enabling it with vmap stacks.
If feature doesn't detect bugs, but waste resources, than it's bad for detecting bugs.
We wasting our limited resources for useless checks, instead of using these resources
for doing more useful checks, running tests faster hence detecting more bugs per-time.

 \ /
  Last update: 2019-01-14 17:08    [W:0.110 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site