From patchwork Tue Mar 29 12:39: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: 12794759 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 D7246C433EF for ; Tue, 29 Mar 2022 12:40:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6559C8D0014; Tue, 29 Mar 2022 08:40:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6038E8D0013; Tue, 29 Mar 2022 08:40:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F3EF8D0014; Tue, 29 Mar 2022 08:40:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 3DD468D0013 for ; Tue, 29 Mar 2022 08:40:54 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 0C8CF81673 for ; Tue, 29 Mar 2022 12:40:54 +0000 (UTC) X-FDA: 79297383228.01.C934E91 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) by imf26.hostedemail.com (Postfix) with ESMTP id B53F0140011 for ; Tue, 29 Mar 2022 12:40:53 +0000 (UTC) Received: by mail-ed1-f73.google.com with SMTP id i4-20020aa7c9c4000000b00419c542270dso5229330edt.8 for ; Tue, 29 Mar 2022 05:40:53 -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=O7QheLFrb7/gpanG0WgUH3CDvOfcWzGQKyw+meqIa2c=; b=nwdrOPNgrlRK/p217vtYWLPWJHANewfRLQpav+XSHbkAVHEnW3oP60FbQ/XxJx5Wey 8DRycD6Z8aEu0MC/3X0fisGnjf5imwmv/pW9pycKVeSdzaHTJ5Rg895wxW0ZrqOGPo10 IfXG+qAD/A/UF9Bi9etjM3pLZn0NbG7nPno2kSpwLlV8g6SDRLw6y8Wk3qoccWfMZ8be drDAk5gciM2kZ8tcU4aiCTs8FvlgiztSYF5pfb76GBFYTSFhMc7u/3/M4f77WEnkaJxj KHDu5r2kXFtX3OnAiGQmLBocYjFXf2eOhSXJmKa/Qj5ogXrOHpI3AL+qNsyyhKmK9AoV 8PsQ== 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=O7QheLFrb7/gpanG0WgUH3CDvOfcWzGQKyw+meqIa2c=; b=mU+1uSothD/yJM8+4HsKblQ2kqONvWcYysWR8Eq/LALebsm7Vt5r8Z0SRzMUKnfFRx e2GvfTn/0EiuXceI+uoPyFsav+jB7A79B4RlBLKB/ednkhdUwDTr8vGvC5KP8FPhxRfG oI2l5ehwMeL8gNKGIXVoFDLHP6+h7vvuwc28UGw0Cq3XVL9/ZmF2eUxFGm0Itg1tdR73 5vMiJCfaLXoG5ILve0zMwZyj7b7OnFgqgKbayyD+Ehmqvbmvzl628S3fiurSUNCs7YBg RzyJudAiSA3eFuUEoVmssSqMbxy1DA+UrrqEPZDzo5B2fiRnVrqNVsrJZS1zXaePE7Hj N7MQ== X-Gm-Message-State: AOAM530QAj3YHHnMAXqy/sL6/Dx+q+NfZxizluEjzYfuI+bw61eEw+QA Sch4ToTscaVFy+PqT8w9zZ8qNU0n83w= X-Google-Smtp-Source: ABdhPJw72M5zTQlc12l/JxfWqejUITTKjW22Nisg7zg2gWpioCaXSJXtz0/OVqyNYeeR7potvImif+IfrBc= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:36eb:759:798f:98c3]) (user=glider job=sendgmr) by 2002:a17:907:60cc:b0:6e0:dab3:ca76 with SMTP id hv12-20020a17090760cc00b006e0dab3ca76mr19088650ejc.154.1648557652185; Tue, 29 Mar 2022 05:40:52 -0700 (PDT) Date: Tue, 29 Mar 2022 14:39:38 +0200 In-Reply-To: <20220329124017.737571-1-glider@google.com> Message-Id: <20220329124017.737571-10-glider@google.com> Mime-Version: 1.0 References: <20220329124017.737571-1-glider@google.com> X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog Subject: [PATCH v2 09/48] 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 , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B53F0140011 X-Stat-Signature: pa4yq7e8w5dkay9j5k4r4hbmk68hx75f X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=nwdrOPNg; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf26.hostedemail.com: domain of 3VP5CYgYKCHUZebWXkZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3VP5CYgYKCHUZebWXkZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--glider.bounces.google.com X-HE-Tag: 1648557653-513786 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 3c1795fdb5686..286675559cbba 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -221,7 +221,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__ */