From patchwork Fri Aug 26 15:07:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12956181 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 C2D0DECAAD4 for ; Fri, 26 Aug 2022 15:08:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 59D9894000F; Fri, 26 Aug 2022 11:08:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 525ED940007; Fri, 26 Aug 2022 11:08:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32A6F94000F; Fri, 26 Aug 2022 11:08:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 21BD4940007 for ; Fri, 26 Aug 2022 11:08:37 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 04290AC0A0 for ; Fri, 26 Aug 2022 15:08:36 +0000 (UTC) X-FDA: 79842075474.21.A9B6208 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) by imf05.hostedemail.com (Postfix) with ESMTP id B962D100008 for ; Fri, 26 Aug 2022 15:08:36 +0000 (UTC) Received: by mail-ed1-f73.google.com with SMTP id b13-20020a056402350d00b0043dfc84c533so1233760edd.5 for ; Fri, 26 Aug 2022 08:08:36 -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; bh=TLtEZ0bDABRCjn67uEnKqh55BiGh6mAGtPfpqU3Dom0=; b=XhlU5hNd0e3S9HPBMmJkefc8yx08LwmA0SrbD/8z4iCrhfOsJcZduc1PlOL9efVBc+ RqztXd6/u4p+K40pJYJ4MKo6W7YSwm2TGNfQJRg+spj7KYsPClZuKVg0K7kt5K6whqKk q+NjffiftBk+4Wc6g4Tz0BBUvyrlit9JdAIemyH8qENuefh4JnuhzYQuq/s4MXy2lHoL NjoHCmqDqQlUi8tcUV7ZMIQKkT1OxE2DmCvSQcE4JHvpg4oQKQDno1JEzzGIKstmVxfI M0cRhGmxUmpadUGkfzrVjEWgWPnBig+aEKw2Ua3xaSSd45CO/SHC+zQxCgI2IVeAmV7R JiAw== 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; bh=TLtEZ0bDABRCjn67uEnKqh55BiGh6mAGtPfpqU3Dom0=; b=w3bF9InGB+dxX2xleuXPFFcS5otuWCs7eKnc4pxLWBj8QyxL/3oGkGYB/0LknUS0DI A0yuYTreHpwNiup9VRfWt3OiNGGG1MM3PKvBTKNFkux1RDxG+zWNjCRS368Eg/XO0wsb u9zHb+UhrIzGD7HPZqorppnSmBNUEZ9OUYudKo0XlMpugtkHaoCJ2VBWJTETQdeEkOFH vC82KzhjNA1KDugvd0fuE23yRw89NfB47HOqi1vgANP0kfke3VLHkvglCZqn8Z3bPOij 3lAeWSv+klyQFyFHbdO7yavqi999pGHo35jBrh2YaBv4rjC/yT1IBl8Ip0+Wx6d46W4q ARpg== X-Gm-Message-State: ACgBeo3nOQKQDnecBEmHewwWaVBNh7ASz1qFYOTHj5Th9LOwHiMFPXrI YiOCRV9HGs0OcP+86GlX0MCx14dxMco= X-Google-Smtp-Source: AA6agR6QdK8Prck1Efax3JC3LSwW7ZoPOT0nuqvyH6CShWmZZX9DGTqKWmC6+Ghh+6F66GZY1zvqUreveU8= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:5207:ac36:fdd3:502d]) (user=glider job=sendgmr) by 2002:a17:906:9752:b0:738:364a:4ac with SMTP id o18-20020a170906975200b00738364a04acmr5783646ejy.759.1661526515449; Fri, 26 Aug 2022 08:08:35 -0700 (PDT) Date: Fri, 26 Aug 2022 17:07:31 +0200 In-Reply-To: <20220826150807.723137-1-glider@google.com> Mime-Version: 1.0 References: <20220826150807.723137-1-glider@google.com> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826150807.723137-9-glider@google.com> Subject: [PATCH v5 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661526516; a=rsa-sha256; cv=none; b=ZoVsaSsAGlgNFRk3k9ou+xbvu9qhA6C/5r4XTVs1PqhOehySVbfOnT0aqa5Y+knezsl657 02xJL6Zuvb3teycejJGrCuKvBcQAZ0FZP0DYsyBvzKiyMtlGNra+VmYfQ4kOK0cIyMoi31 zrTqAFNKiVgEXJH1YcNFXmD7IyQcVj4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=XhlU5hNd; spf=pass (imf05.hostedemail.com: domain of 38-EIYwYKCPglqnijwlttlqj.htrqnsz2-rrp0fhp.twl@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=38-EIYwYKCPglqnijwlttlqj.htrqnsz2-rrp0fhp.twl@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661526516; 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=TLtEZ0bDABRCjn67uEnKqh55BiGh6mAGtPfpqU3Dom0=; b=i/06Nn3tyi64hdDrF4UG2N1vLsBeRVRL94L59atW3IODMrIG5+czfwr9Abo+DYZ+0FUzB0 JZgO3jNBPk4/4xS/H7+d2qIhKqapmyHLjVi8kSZOrqInDPDyq/PXkHOlf4JExum0Pzwx0C XY9qtV7CEoHfZN1suAxaq1P5f+3IAoM= X-Stat-Signature: fuphqth5d3uaoxw7gmwcngcn7j8bjwoq X-Rspamd-Queue-Id: B962D100008 X-Rspam-User: X-Rspamd-Server: rspam06 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=XhlU5hNd; spf=pass (imf05.hostedemail.com: domain of 38-EIYwYKCPglqnijwlttlqj.htrqnsz2-rrp0fhp.twl@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=38-EIYwYKCPglqnijwlttlqj.htrqnsz2-rrp0fhp.twl@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1661526516-259609 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__ */