From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751222AbbJELqa (ORCPT ); Mon, 5 Oct 2015 07:46:30 -0400 Received: from mx2.parallels.com ([199.115.105.18]:52628 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750901AbbJELq3 (ORCPT ); Mon, 5 Oct 2015 07:46:29 -0400 Subject: Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() To: Dmitry Vyukov , Ingo Molnar References: <1444040906-6788-1-git-send-email-aryabinin@virtuozzo.com> <20151005112341.GA1101@gmail.com> CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , LKML , Andy Lutomirski , Andrey Konovalov , Kostya Serebryany , Alexander Potapenko , kasan-dev , Borislav Petkov , Denys Vlasenko , Andi Kleen , Sasha Levin , Wolfram Gloger , Linus Torvalds , Andrew Morton From: Andrey Ryabinin Message-ID: <56126316.3030901@virtuozzo.com> Date: Mon, 5 Oct 2015 14:46:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: US-EXCH2.sw.swsoft.com (10.255.249.46) To US-EXCH2.sw.swsoft.com (10.255.249.46) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/2015 02:39 PM, Dmitry Vyukov wrote: >> >> But that's all pretty disgusting really. >> >> Cannot we do better, such as annotating the function and then KASAN sorting out >> its false positives, or something like that? > > > We also plug __attribute__((no_sanitize_address)) on the function. > It's absolutely unusable:( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 If we add it here, it won't built because of: '__always_inline __read_once_size()' But, I think I have the solution. We could have some blacklist - list of function names which we should be ignored. In kasan_report() we could resolve return address to function name and compare it with name in list. If name in list -> ignore report.