From patchwork Tue Apr 26 16:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12827491 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 56495C433EF for ; Tue, 26 Apr 2022 16:44:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3A5A6B0085; Tue, 26 Apr 2022 12:44:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DEB946B0087; Tue, 26 Apr 2022 12:44:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8A556B0088; Tue, 26 Apr 2022 12:44:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id BB2E56B0085 for ; Tue, 26 Apr 2022 12:44:45 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 8498D120B66 for ; Tue, 26 Apr 2022 16:44:45 +0000 (UTC) X-FDA: 79399604130.30.83F5A2E Received: from mail-lj1-f202.google.com (mail-lj1-f202.google.com [209.85.208.202]) by imf26.hostedemail.com (Postfix) with ESMTP id 65716140042 for ; Tue, 26 Apr 2022 16:44:43 +0000 (UTC) Received: by mail-lj1-f202.google.com with SMTP id n9-20020a2e82c9000000b002435af2e8b9so4785385ljh.20 for ; Tue, 26 Apr 2022 09:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ednioRVQi+463GyxSxojLtYXRmMb4k6reZrR8s7PDTk=; b=s7nDKeE2uO8tPBSHXhKtgeVd4KJBULrFKzji5KxbrLSqAsd9qwd5XqsiW4sxXc2Zuj /LDHzi6oYDxLjayBmNbbHHd8x60Z1q11m24TiSwhP8RYbreiv3W6YuCWDnMHnOA40Zg6 2XAh/SQC3o2WwNcd888BCR1ayDkPme9nLNf+yFJmAhhH+5m2makPEnGrUgDcpKDvSpAx uZ/EMSRFu7oZ7g4w8LFxCUmwK7SAeXqsUvws74aRat1Udaq+/e8oYjQBcJ/MQ0phtMYp ItWJ4UPus1+bGv6Mz6YHzcXh/jQw/SqfpbBVzObyfR2JQ5g2erl9ttRuMQ0dfEHG3Yf8 GoPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ednioRVQi+463GyxSxojLtYXRmMb4k6reZrR8s7PDTk=; b=S+PgetjpPXxCgfmxQnJW/F2s7uggX7sB7ek58ZHDyazHmb4/7jbseAl58VkwZ/Iv6M cTxJuwLuypAMCQJAMkuOauPrLBGJSPyxx4RNEEcuVunhHhcutcC7+Tew9JcI7uSg/UVg 6KyzKecMRyW+WBaUUfCWkjv08X43CNvnrUluUK1d+nS/gohFHLsgFdfW3pA2e1dJvZnJ x6Hd6gbSpE5Tt2FIdh446+z7REMkhwgz+gs7BG2oBOv4VFpDUcjdg/Uow484qLwt+PoM Gl+FP57uCslsRdxpjTNExgB1byeWTTqj06kPZaBD6S5hvhThnxrawU0cuDWdlrA4xYHZ gUJw== X-Gm-Message-State: AOAM533IA0BrHGofJACx9p3Ez/fb0PlmAAR3Ol4F3Uygnnv/1befBm/A z0uFnuY7PYLKHnPUeoDEwYdAZDqaQ7E= X-Google-Smtp-Source: ABdhPJxHrJcKOCcTiJCxWbbHxqyDNc8yKbgnQVG+zhnL2F1NE0oryK8Ze862y3s98aS3FdAQ1AuU/NMiTCE= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:d580:abeb:bf6d:5726]) (user=glider job=sendgmr) by 2002:a05:6512:114f:b0:471:b097:4a29 with SMTP id m15-20020a056512114f00b00471b0974a29mr17572189lfg.93.1650991483323; Tue, 26 Apr 2022 09:44:43 -0700 (PDT) Date: Tue, 26 Apr 2022 18:42:38 +0200 In-Reply-To: <20220426164315.625149-1-glider@google.com> Message-Id: <20220426164315.625149-10-glider@google.com> Mime-Version: 1.0 References: <20220426164315.625149-1-glider@google.com> X-Mailer: git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog Subject: [PATCH v3 09/46] kmsan: mark noinstr as __no_sanitize_memory From: Alexander Potapenko To: glider@google.com Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , 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 , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org X-Stat-Signature: sgqmko3zhhdapf8hj4e79t3uyhn8fibb X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 65716140042 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=s7nDKeE2; spf=pass (imf26.hostedemail.com: domain of 3eyFoYgYKCHgcheZanckkcha.Ykihejqt-iigrWYg.knc@flex--glider.bounces.google.com designates 209.85.208.202 as permitted sender) smtp.mailfrom=3eyFoYgYKCHgcheZanckkcha.Ykihejqt-iigrWYg.knc@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1650991483-886966 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: noinstr functions should never be instrumented, so make KMSAN skip them by applying the __no_sanitize_memory attribute. Signed-off-by: Alexander Potapenko --- v2: -- moved this patch earlier in the series per Mark Rutland's request Link: https://linux-review.googlesource.com/id/I3c9abe860b97b49bc0c8026918b17a50448dec0d --- include/linux/compiler_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 1c2c33ae1b37d..a9ba5edd8208b 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -227,7 +227,8 @@ struct ftrace_likely_data { /* Section for code which can't be instrumented at all */ #define noinstr \ noinline notrace __attribute((__section__(".noinstr.text"))) \ - __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage + __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage \ + __no_sanitize_memory #endif /* __KERNEL__ */