lkml.org 
[lkml]   [2016]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kasan: support use-after-scope detection
On Wed, Nov 16, 2016 at 12:40 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Tue, 15 Nov 2016 17:07:25 +0100 Dmitry Vyukov <dvyukov@google.com> wrote:
>
>> Gcc revision 241896 implements use-after-scope detection.
>> Will be available in gcc 7. Support it in KASAN.
>>
>> Gcc emits 2 new callbacks to poison/unpoison large stack
>> objects when they go in/out of scope.
>> Implement the callbacks and add a test.
>>
>> ...
>>
>> --- a/lib/test_kasan.c
>> +++ b/lib/test_kasan.c
>> @@ -411,6 +411,29 @@ static noinline void __init copy_user_test(void)
>> kfree(kmem);
>> }
>>
>> +static noinline void __init use_after_scope_test(void)
>
> This reader has no idea why this code uses noinline, and I expect
> others will have the same issue.
>
> Can we please get a code comment in there to reveal the reason?

Mailed v2 with a comment re noinline.

Taking the opportunity also fixed a type in the new comment:

- /* Emitted by compiler to unpoison large objects when they go into
of scope. */
+ /* Emitted by compiler to unpoison large objects when they go into scope. */

\
 
 \ /
  Last update: 2016-11-16 08:24    [W:0.123 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site