From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbbJEQjJ (ORCPT ); Mon, 5 Oct 2015 12:39:09 -0400 Received: from mga09.intel.com ([134.134.136.24]:14515 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbbJEQjH (ORCPT ); Mon, 5 Oct 2015 12:39:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,639,1437462000"; d="scan'208";a="658238221" Date: Mon, 5 Oct 2015 09:39:06 -0700 From: Andi Kleen To: Andrey Ryabinin Cc: Dmitry Vyukov , Ingo Molnar , 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 , Sasha Levin , Wolfram Gloger , Linus Torvalds , Andrew Morton Subject: Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Message-ID: <20151005163906.GE26924@tassilo.jf.intel.com> References: <1444040906-6788-1-git-send-email-aryabinin@virtuozzo.com> <20151005112341.GA1101@gmail.com> <56126316.3030901@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56126316.3030901@virtuozzo.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. I think annotating statements is cleaner than functions, even if it is more code. Much better documentation But if you really want to annotate on the function level: It's better to annotate the function directly than some hidden away list. This way there is some indication that there are races in there, which is generally useful documentation. __racy_function or similar. Also central lists are generally annoying as they cause patch conflicts. If disabling with an attribute doesn't work, you could put it into a special section with __attribute__((section ...)) and check the start/end symbol before reporting. That's how kprobes solves similar issues. It also has the advantage that it stops inlining. -Andi