From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933639AbcKOXkF (ORCPT ); Tue, 15 Nov 2016 18:40:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43542 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308AbcKOXkD (ORCPT ); Tue, 15 Nov 2016 18:40:03 -0500 Date: Tue, 15 Nov 2016 15:40:02 -0800 From: Andrew Morton To: Dmitry Vyukov Cc: aryabinin@virtuozzo.com, glider@google.com, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kasan: support use-after-scope detection Message-Id: <20161115154002.0c4c7a5e1fd23f12474fc80e@linux-foundation.org> In-Reply-To: <1479226045-145148-1-git-send-email-dvyukov@google.com> References: <1479226045-145148-1-git-send-email-dvyukov@google.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Nov 2016 17:07:25 +0100 Dmitry Vyukov 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?