From patchwork Tue Mar 29 12:40:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12794788 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 66777C433FE for ; Tue, 29 Mar 2022 12:42:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 012038D0007; Tue, 29 Mar 2022 08:42:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F040C8D0005; Tue, 29 Mar 2022 08:42:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA35E8D0007; Tue, 29 Mar 2022 08:42:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id CB3818D0005 for ; Tue, 29 Mar 2022 08:42:12 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9ED9D23E63 for ; Tue, 29 Mar 2022 12:42:12 +0000 (UTC) X-FDA: 79297386504.04.8E9345F Received: from mail-ej1-f73.google.com (mail-ej1-f73.google.com [209.85.218.73]) by imf25.hostedemail.com (Postfix) with ESMTP id 1E186A0003 for ; Tue, 29 Mar 2022 12:42:11 +0000 (UTC) Received: by mail-ej1-f73.google.com with SMTP id zd21-20020a17090698d500b006df778721f7so8058103ejb.3 for ; Tue, 29 Mar 2022 05:42:11 -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=T39GYI/vBjMdfMtH+Dx38ArgDU/LjDSVRO95NSUKYys=; b=Ga2g0KSm7zN5HCLMp88eZDrOW0thBYZOgl2SJsxhqq1/9JhR9hzR13gng3zeCxso+w i/qtco4gzCEgnTlb2mhL9BTKSiQMQJdKNozm6n1+hL+sDqOwULwTLCdwyrZELS+NA7W/ c5qB98YvHHLJ3BMBq1pJMPQpE9RNLyE4eXN+o9MmFC6t7LQ+u14xMMOIVA+bA5naY+8s gRNrHJavp3e4jVaVQltJlMKiFbXubOTSrISRSTmFuJe4c/qmXIPakHSoPpaD9bKOA9pq oeNXL7OnbYXNrhPT7iXlkE3Z7JYvDzAHoBqV8prd4N81xr62OjBryDQm9qe/C7bS4tTD qDsQ== 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=T39GYI/vBjMdfMtH+Dx38ArgDU/LjDSVRO95NSUKYys=; b=ZH1a6XwC4EvXV16uMquMXwQ6qMvzoyIJg6J+8nt0hcA85hFLYIIrsnnBJoLVO2ymc0 gwSJ+2H3GM60cg66s8HxWJvUOTgU+yYFJ6FgdGbNhPQ/AFb2MEa4A55weHR/K+EJt6Xb +60CzBveyP3WXtGTXh+WU3awKO1RIKhW4df0XO3yK7NxSCMu8zu/VR2/ho68Pe6V74Hp k5RBNTfSjgpfhYg14S5UwUkUTBT32dTlVzYO3/PVAJnnbkjJHQ7W602+kUQ8N2LCMJKo 9RchdLgtzUREG4lh6BZPfbIXEH8OxA9xtGmBvHlNMBs3dBn3Vg8gtyW5S54Kp5ftiiXm O37A== X-Gm-Message-State: AOAM532DO0Ib1WM7e/GU8PGgarqC77K0zb17N20pfu++3MDDokAPpwsC YmZXPFKTCi5/yBZdBXaO6L0hGWeuDxA= X-Google-Smtp-Source: ABdhPJxnAD1WnRha3aT8bQpiv1ryLHN37wPgdzyd6u5jtCYTidxo5YWhjtFuZMhdjM/eFbjpolf6XzG13+Y= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:36eb:759:798f:98c3]) (user=glider job=sendgmr) by 2002:a17:907:1ca4:b0:6da:86a4:1ec7 with SMTP id nb36-20020a1709071ca400b006da86a41ec7mr34900718ejc.556.1648557730788; Tue, 29 Mar 2022 05:42:10 -0700 (PDT) Date: Tue, 29 Mar 2022 14:40:07 +0200 In-Reply-To: <20220329124017.737571-1-glider@google.com> Message-Id: <20220329124017.737571-39-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 38/48] objtool: kmsan: list KMSAN API functions as uaccess-safe 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 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Ga2g0KSm; spf=pass (imf25.hostedemail.com: domain of 3ov5CYgYKCMMpurmn0pxxpun.lxvurw36-vvt4jlt.x0p@flex--glider.bounces.google.com designates 209.85.218.73 as permitted sender) smtp.mailfrom=3ov5CYgYKCMMpurmn0pxxpun.lxvurw36-vvt4jlt.x0p@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1E186A0003 X-Stat-Signature: 1z37tozdxeoj7u8s9is99jcxu7qs8fps X-HE-Tag: 1648557731-658167 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: KMSAN inserts API function calls in a lot of places (function entries and exits, local variables, memory accesses), so they may get called from the uaccess regions as well. Signed-off-by: Alexander Potapenko --- Link: https://linux-review.googlesource.com/id/I242bc9816273fecad4ea3d977393784396bb3c35 --- tools/objtool/check.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 7c33ec67c4a95..8518eaf05bff0 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -943,6 +943,25 @@ static const char *uaccess_safe_builtin[] = { "__sanitizer_cov_trace_cmp4", "__sanitizer_cov_trace_cmp8", "__sanitizer_cov_trace_switch", + /* KMSAN */ + "kmsan_copy_to_user", + "kmsan_report", + "kmsan_unpoison_memory", + "__msan_chain_origin", + "__msan_get_context_state", + "__msan_instrument_asm_store", + "__msan_metadata_ptr_for_load_1", + "__msan_metadata_ptr_for_load_2", + "__msan_metadata_ptr_for_load_4", + "__msan_metadata_ptr_for_load_8", + "__msan_metadata_ptr_for_load_n", + "__msan_metadata_ptr_for_store_1", + "__msan_metadata_ptr_for_store_2", + "__msan_metadata_ptr_for_store_4", + "__msan_metadata_ptr_for_store_8", + "__msan_metadata_ptr_for_store_n", + "__msan_poison_alloca", + "__msan_warning", /* UBSAN */ "ubsan_type_mismatch_common", "__ubsan_handle_type_mismatch",