From patchwork Mon Sep 5 12:24:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12966039 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 588A7ECAAD3 for ; Mon, 5 Sep 2022 12:25:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D82E68D006F; Mon, 5 Sep 2022 08:25:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D31D28D0050; Mon, 5 Sep 2022 08:25:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFB7C8D006F; Mon, 5 Sep 2022 08:25:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B01468D0050 for ; Mon, 5 Sep 2022 08:25:20 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8EB8D1A0D96 for ; Mon, 5 Sep 2022 12:25:20 +0000 (UTC) X-FDA: 79877952000.04.CB2A3EC Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) by imf26.hostedemail.com (Postfix) with ESMTP id 357CE14008D for ; Mon, 5 Sep 2022 12:25:20 +0000 (UTC) Received: by mail-ed1-f74.google.com with SMTP id z20-20020a05640235d400b0043e1e74a495so5773697edc.11 for ; Mon, 05 Sep 2022 05:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=eIK0S734s+WuMuzHGxUrnoQabUzsOPxTYvMm/ke78tI=; b=SLwXQbzPHQT2lx3CmDALMMsEHTfh2C5fRJjzD2NlQVdV1yZDtABiy9mOeHVVuGOF9M m+WfedhfS8OqwiHcSKlOk6gYgctS/yniai+qVNtBv5itHrKEx2UUKP7JuUqvWGoiUZ4p 7UKv1IjobR+tSAj44q8qK4JrQfYF0y6m7kSyZsm4AYQa+8vlkP8GyIWNlUOWl7r0oTxr pBGpVAhHvoR7nzE9+LR6V3BmAQ4A38y6A4NEtxM3wQYP7pY788MI3NEB1eRmB+H0zfeL mXGxy3ik2fCQk/7rDv6yt5ahyqOIzF0oPNuxvRUmCGjRKzXXFL9mefRo74jNp3st4QcE +LBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=eIK0S734s+WuMuzHGxUrnoQabUzsOPxTYvMm/ke78tI=; b=zoxellpX2M9NMY1CgBe3aIhPSFhWfICVvbjmdUx6pORC5u1LqADsX/aObzxeE4vpxP 0kp3J18+vDvOksaBk+tBYe6l3VGhtRrMBrxEiu5Mtul0NZpXXc4kEJWYRbH9lomV9GoI D0fjkGYH2YZmSXfpZ9m19vir07Bx8RMon5rt9PxRHB5Yqnx7E63IMknZH0Gpva1BCYLP WLsAe5dhzyGPFcuBDd6kHkb6xW3EPXVmFK0qDoRUJKTv9b963kP23JqeCRQTHzp2NhzL /18DuaVOpHQURXV+eX5zdD8pNzcLGMCEEjsVqnWtYLOneOBfu6GXkzISo0kEWs8HVNNC Rm1w== X-Gm-Message-State: ACgBeo28rnzR2SrGokdLxdhssQbRqVKPB/uUBGiKKsd2C/NH9L6KVqPw fL3FEkvlGRgfKWIgIEdSGTW7qhOBgD0= X-Google-Smtp-Source: AA6agR7bXvSnVNQUJmYARonFyFhbVF2eDdfDU/CHIrufPEs62rsTK65KVDoWR72fO1/TGY+y+ld4j+iRz5E= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:b808:8d07:ab4a:554c]) (user=glider job=sendgmr) by 2002:a05:6402:2937:b0:44e:b578:6fdd with SMTP id ee55-20020a056402293700b0044eb5786fddmr722840edb.159.1662380719065; Mon, 05 Sep 2022 05:25:19 -0700 (PDT) Date: Mon, 5 Sep 2022 14:24:16 +0200 In-Reply-To: <20220905122452.2258262-1-glider@google.com> Mime-Version: 1.0 References: <20220905122452.2258262-1-glider@google.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220905122452.2258262-9-glider@google.com> Subject: [PATCH v6 08/44] kmsan: mark noinstr as __no_sanitize_memory From: Alexander Potapenko To: glider@google.com Cc: Alexander Viro , Alexei Starovoitov , 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 ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=SLwXQbzP; spf=pass (imf26.hostedemail.com: domain of 3r-oVYwYKCPoinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3r-oVYwYKCPoinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662380720; a=rsa-sha256; cv=none; b=cbZX8Ta2R8CsfPAYbfnNq1oyZHR4R/FnLA6VET9Mc3iDhM51rvHvmL2LGP6Td3Zf4b2Koa QmiVe6a087BuxdskuqKdtMnWncCxq5Kz+t07l7bnCHu+dUR9mXrsWkVk+qrDiQdmsuRxtM HAV6oFGVDY8SqPUysnaP3Qa4xHMILzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662380720; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eIK0S734s+WuMuzHGxUrnoQabUzsOPxTYvMm/ke78tI=; b=JFVzlhfeXAEWk7AsaVVX9lrO4+5sZt208XvG9rfcYdynvBDgp16cyXIneYmAr2yHAnmrZG rswWxpjHUu4drTtSSJK//rF7g9EFXVaquVkSfsl+xVw1U4bkS1XeDaOjLsu1aRzyFASDCV 8JCOOYQ+HA2R4WRlGmAhtD18QunRCQ0= X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=SLwXQbzP; spf=pass (imf26.hostedemail.com: domain of 3r-oVYwYKCPoinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3r-oVYwYKCPoinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 357CE14008D X-Stat-Signature: 1gsekipkozzxz6tzupsi9pk8d8bqzrr8 X-HE-Tag: 1662380720-253334 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 Reviewed-by: Marco Elver --- 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 4f2a819fd60a3..015207a6e2bf5 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -229,7 +229,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__ */