From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EDC8C433F5 for ; Wed, 15 Dec 2021 13:34:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EEA26B0071; Wed, 15 Dec 2021 08:33:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 99DD56B0073; Wed, 15 Dec 2021 08:33:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83EC76B0074; Wed, 15 Dec 2021 08:33:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 6FABC6B0071 for ; Wed, 15 Dec 2021 08:33:59 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2990B89119 for ; Wed, 15 Dec 2021 13:33:49 +0000 (UTC) X-FDA: 78920121378.15.6AD8359 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by imf19.hostedemail.com (Postfix) with ESMTP id B58E81A0013 for ; Wed, 15 Dec 2021 13:33:48 +0000 (UTC) Received: by mail-oi1-f180.google.com with SMTP id m6so31685015oim.2 for ; Wed, 15 Dec 2021 05:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+UPZ8+IiM8moYke3aTaWDfXyTBb8QigFqjdfGzKzRHI=; b=PaPRw7IBxZHKc5ILCJ29MsY7mY986DE2gwQY8C3fRUR+MaYQQkXCggtY5Lh2Y5M0AL R7j/A5oBHl8jikEzl5nda+ERST+L5Pu2gI4rODC3JETMEf11N59UdfwaQ4NOJpm7Z0nU Zl5HZxFumLn9fN6nX7eak8f9s+l5tbgng4JkbO2sXzVRvCSHip68N1nJt2gK5nSNJHLu 5sWmyyhbV6nzN52T2/a9YQZeRTuyc3174FC/AS0aCGx9J6rkMtNpgXKQQ8Rmd1r2EJlY ZkeneAaXms3GBifMdXWQLIu7jFzQ/w+tZ6stLtJ9DXkrszofMhMvWP4Zp4eJE3qbM/50 TEhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+UPZ8+IiM8moYke3aTaWDfXyTBb8QigFqjdfGzKzRHI=; b=HpHbnaxFCYWkk6H30m/HeOwfRL2/qQGywQil/euiqyEXKXLdO6eKkU1sWo6rQvq1tD IIDjsAh7O1UArUhYkVGBT2jGzzf+8AJjyql5jYbdoVUjdcTDXsVdl8rx4zG/wkWsv0F8 y3sdSvG8UIUQjAnBCiB/+ce4wK44Wc1MG02XmIZEQMizZT91ksr9Ff24idoTGkMQDpWT xj9Msna0rilu09/axrG03dRxQMXymqmNuM4E7vpXgnMx/QLvpCLR4FK06/lfDcQnahea 7O8iXm9/xF1JuHbSJ/uiZ50MmzE2ERRbEgXxE0rQ07l8ofAUxWz0LoWnmtOnIqoOeufw 5RUg== X-Gm-Message-State: AOAM531RiDjwNvA6+ZllVeQxhIcf2LF/6GxI0MILfO29XNIDt9RBXcx3 ataTthewnDRqfmEb3C57HxPV71/Ufq8xYZXti7J3Ew== X-Google-Smtp-Source: ABdhPJwls0NdSP7Nakul5Uh/+/AETU5z3undj37BDbMiS8w/mD1/nppX+S6J6Jr9AmyO2qoNBZij6JO0uWm8eoPZFN0= X-Received: by 2002:aca:af50:: with SMTP id y77mr8591431oie.134.1639575227493; Wed, 15 Dec 2021 05:33:47 -0800 (PST) MIME-Version: 1.0 References: <20211214162050.660953-1-glider@google.com> <20211214162050.660953-8-glider@google.com> In-Reply-To: From: Marco Elver Date: Wed, 15 Dec 2021 14:33:34 +0100 Message-ID: Subject: Re: [PATCH 07/43] compiler_attributes.h: add __disable_sanitizer_instrumentation To: Mark Rutland Cc: Alexander Potapenko , Peter Zijlstra , Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=PaPRw7IB; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of elver@google.com designates 209.85.167.180 as permitted sender) smtp.mailfrom=elver@google.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B58E81A0013 X-Stat-Signature: uiufxmmfhkbtd7j95xomh1xnj7wwxbhu X-HE-Tag: 1639575228-174335 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: A On Wed, 15 Dec 2021 at 14:24, Mark Rutland wrote: > > On Tue, Dec 14, 2021 at 05:20:14PM +0100, Alexander Potapenko wrote: > > The new attribute maps to > > __attribute__((disable_sanitizer_instrumentation)), which will be > > supported by Clang >= 14.0. Future support in GCC is also possible. > > > > This attribute disables compiler instrumentation for kernel sanitizer > > tools, making it easier to implement noinstr. It is different from the > > existing __no_sanitize* attributes, which may still allow certain types > > of instrumentation to prevent false positives. > > When you say the __no_sanitize* attributes allow some instrumentation, does > that apply to any of the existing KASAN/KCSAN/KCOV support, or just for KMSAN? > > The documentation just says the same as the commit message: > > | This is not the same as __attribute__((no_sanitize(...))), which depending on > | the tool may still insert instrumentation to prevent false positive reports. > > ... which implies the other instrumentation might not be suprressed. > > I ask because architectures which select ARCH_WANTS_NO_INSTR *need* to be able > to suppress all instrumentation. It's fine if that means they need a new > version of clang for KMSAN, but if there's latent instrumentation we have more > bugs to fix first... Thus far, none of the existing K*SANs added other instrumentation. Apart from KMSAN here, this will change with KCSAN's barrier instrumentation, which is why this patch is also part of KCSAN's upcoming changes -- recall I said I fixed barrier instrumentation for arm64 as well, this is how :-) See https://lore.kernel.org/all/20211130114433.2580590-26-elver@google.com/ how I resolved it for KCSAN on architectures that don't have objtool. I expect this patch will be dropped from the KMSAN series once it reaches mainline through the KCSAN changes. Also note, this applies only for bug-detection tools, that may want to avoid false positives. So by definition, it is irrelevant for KCOV (which had its own attribute woes a while back though). Yeah, it's been a long road to get the compilers to play along ... :-/ Thanks, -- Marco