From patchwork Fri Jul 1 14:22:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12903365 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 688F0C433EF for ; Fri, 1 Jul 2022 14:23:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 006946B0080; Fri, 1 Jul 2022 10:23:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED0AD6B0081; Fri, 1 Jul 2022 10:23:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4AE26B0082; Fri, 1 Jul 2022 10:23:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C4DE26B0080 for ; Fri, 1 Jul 2022 10:23:39 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 9F46A8031D for ; Fri, 1 Jul 2022 14:23:39 +0000 (UTC) X-FDA: 79638749358.28.1A7EA04 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) by imf17.hostedemail.com (Postfix) with ESMTP id 3AA684003F for ; Fri, 1 Jul 2022 14:23:39 +0000 (UTC) Received: by mail-ed1-f73.google.com with SMTP id c20-20020a05640227d400b004369cf00c6bso1887527ede.22 for ; Fri, 01 Jul 2022 07:23:38 -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=os0Zx5VZv6p+Rm8I/hkYFMfJuZRHr+O61ed8WspeRIk=; b=OV7vbBjecQ+2aw/zjF5UI7FBbnLXSdlTtfDvhPtucRYMTl+svaPlqkq36KZQsvGhP/ ne8e4l8I3/0GRvxegtfKUO6cwS2qPksp9NrQQ5lnpQwHWvK+HWlKJBwNEAVhhJIwF7u5 Ns847PNFYy8k60pdHRyM2PsMAizAqLlGYbkafF+wOEnPqhwIwE4aYtsL1hd1Jq6fCqFz ce+lc///QcEti81QlLr7Y54ODBIMH5AChXdc7cPCvHBnFhpkGjgRkrjcUhJb8u74OZGE PCvurUMEpDHYof925nelBMEr785dzxSUlTT5q2hRH/q3uOyGgTsSk9NCo4066mule3qb +5Dw== 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=os0Zx5VZv6p+Rm8I/hkYFMfJuZRHr+O61ed8WspeRIk=; b=6wV41jXW9wV5KX/G6eIXxgQgrW4aWqTqOBrgkP1p0dcI6uEhsWwHQE3zunstvn3ANt a93Mzhs6WM86Ta0yfdHsV49WsdHROl451fBhqt9YCJSNlAdq2CNThDDXrZiaH8oPu81s i3lCgnO1g+gCOm66jLhKoqSBy7U9T/uuKxNGZrGs0I72dTxFsQu/R+2AurBGH0Df+yP7 TA9si9BmKxM1MJDpfhonlmTDnWgiQD3fk6oaXd5/jLWbjBZyoc3P2Qnt1laEQ1XPBFYK drG2DDPVoVAo0Ek7MvjAm6/pEl2iOkexV3fVMw7Fuag7/NwcgmnXZcjJeboDXrUXe1iF V8Ng== X-Gm-Message-State: AJIora+IEOuqn7Ywfci1dIo8uJKlgzm1cjum7q0YT7OQ/ywGWDslrFs7 8mxF/VFNIlWiAfB3O+85Kgdu/EoZ4qk= X-Google-Smtp-Source: AGRyM1sWpivMRCzyWBt2NMDYpIZXoVXItcZn0l1qEGR/DeU09TxwkO65LsmcVUOum8/EZGKYMgfViYv/FwA= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:a6f5:f713:759c:abb6]) (user=glider job=sendgmr) by 2002:a05:6402:4244:b0:437:726c:e1a with SMTP id g4-20020a056402424400b00437726c0e1amr19866573edb.107.1656685417915; Fri, 01 Jul 2022 07:23:37 -0700 (PDT) Date: Fri, 1 Jul 2022 16:22:33 +0200 In-Reply-To: <20220701142310.2188015-1-glider@google.com> Message-Id: <20220701142310.2188015-9-glider@google.com> Mime-Version: 1.0 References: <20220701142310.2188015-1-glider@google.com> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [PATCH v4 08/45] 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656685419; 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=os0Zx5VZv6p+Rm8I/hkYFMfJuZRHr+O61ed8WspeRIk=; b=e/B/rIukoKklUzD5lF7OrGjHluX9EDRKbGS19FLps5mdUO+DhZb7bVJofbtXJgH2Wu+wRE gfsdXhq0FaXrHG4jtgBfk7U1g/WhECNL2GxdX1qVfydhxZSmh9/F0P2+wusNHxp2roy8tg eMb3E7/9PwKUxMgdH+D4kbetNcMjNks= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656685419; a=rsa-sha256; cv=none; b=LcuK0wTP+iT4ul61Y/KcOvelOCYy9Gx/5lbCiAXYxd4hbhFOIh8FOGriqCDLz9jCwwPdiu 5nskUy8rwb9zEqplmXdshpyvEmNSjwlczaIzbFJui3LKi3wYBT2enN5tbVWGuEgRUkAx2t i7a+4DQ8FSKxX+CObLoocyO7RqALOB0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=OV7vbBje; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3aQO_YgYKCIgsxupq3s00sxq.o0yxuz69-yyw7mow.03s@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3aQO_YgYKCIgsxupq3s00sxq.o0yxuz69-yyw7mow.03s@flex--glider.bounces.google.com Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=OV7vbBje; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3aQO_YgYKCIgsxupq3s00sxq.o0yxuz69-yyw7mow.03s@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3aQO_YgYKCIgsxupq3s00sxq.o0yxuz69-yyw7mow.03s@flex--glider.bounces.google.com X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: t5k7ejcem5u7pfdpiedkrnkkw6hkuq9o X-Rspamd-Queue-Id: 3AA684003F X-HE-Tag: 1656685419-391381 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 d08dfcb0ac687..fb5777e5228e7 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__ */