From patchwork Tue Dec 14 16:20:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12676423 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 2A4A7C433EF for ; Tue, 14 Dec 2021 16:45:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 03F6A6B00AB; Tue, 14 Dec 2021 11:24:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F31506B00AC; Tue, 14 Dec 2021 11:23:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD1C16B00AD; Tue, 14 Dec 2021 11:23:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id CE60C6B00AB for ; Tue, 14 Dec 2021 11:23:59 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 98FB888CC7 for ; Tue, 14 Dec 2021 16:23:49 +0000 (UTC) X-FDA: 78916920978.10.03D4490 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf04.hostedemail.com (Postfix) with ESMTP id 631EA40017 for ; Tue, 14 Dec 2021 16:23:48 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id q17-20020adfcd91000000b0017bcb12ad4fso4851744wrj.12 for ; Tue, 14 Dec 2021 08:23:48 -0800 (PST) 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=DRsUBze0TCq/8OPjxRo856aiOc30zNOBN3bl6uBcnGs=; b=pb+BQoZ+20k4jQn45XqB5EEUKM9VUAj9iuAHLbPgyXtF8+YsW/fWdE2vL6sFEFEoyK tWCv5yjZsXSeiLNcRp7Ukw9zJKfdtRTRck34pTDgR3eAKHXUMHwrxvmjrt0vnrCi9Ntj VcSfevLftX/8QebdbsT2/yyELtFYLs0K5L5GeCrGFcj/LwYUDawmOOwWa5lI+UYiUV6d aDd+xSGh3C+3mSWHyY145Tmd8x8T+UjCaGtCtAdmAUcJGTsJ04N7Px5YHgXcZ0IIbHVR KHuCXm+v9/dfHaUfRJl4TuJQOxWAjETiKDDAkBqZM45Aiw8oYXWucw0t068DlQk8Wo5C zofw== 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=DRsUBze0TCq/8OPjxRo856aiOc30zNOBN3bl6uBcnGs=; b=h7HK9jp91FgUJt7oYCleZkKJrz93m+7dzipiUETgKJUkHXkE5NnO/Pq6o4JC/gUxSl 0YUXGAbv4kfO7navAbgdIX6W1GmMxp4YpOQ3Qaq3MszOaMy11PgeW5vczq6TaCQ/CJKn bZTBIZkmovH9YGq8ekvMmKAXzbIflSg1q6DZFjOSnYcnPVBE23mqSyhl2mrLeG6ESbWq WzP7p8njyzszLd8aPK0D1LYpkqAfkdzI6bxgpySLd+/Qwb/l/K5c/i6rwYjRGqA6UPOq j7Ire6i+AD+c8DkYZN+3PvICpbSkX0UhDxj/LWOcHxZ4HJUcEkh2spAjZdVX4ETzkXAN nalA== X-Gm-Message-State: AOAM531QAW9E10fGM9nGDv+NRojjcpcDED7ij/GPBHRee1rDOq0JF0G1 KhuTDo39Hcc+7hZbfus25ugR5wB4U/Q= X-Google-Smtp-Source: ABdhPJzbEf5lWlF6RWfh8Re9EBCpxKO3TumG/VSHFoE+dz+wF3Gg0ijQABT1lDRRxNcQr8YrfKX8rhC5/wo= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:357e:2b9d:5b13:a652]) (user=glider job=sendgmr) by 2002:a5d:644f:: with SMTP id d15mr6736523wrw.662.1639499027200; Tue, 14 Dec 2021 08:23:47 -0800 (PST) Date: Tue, 14 Dec 2021 17:20:49 +0100 In-Reply-To: <20211214162050.660953-1-glider@google.com> Message-Id: <20211214162050.660953-43-glider@google.com> Mime-Version: 1.0 References: <20211214162050.660953-1-glider@google.com> X-Mailer: git-send-email 2.34.1.173.g76aa8bc2d0-goog Subject: [PATCH 42/43] 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 , Ard Biesheuvel , 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 , 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: rspam09 X-Rspamd-Queue-Id: 631EA40017 X-Stat-Signature: 1sc81oiy365bi3pi3njxigdmaskms4fh Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=pb+BQoZ+; spf=pass (imf04.hostedemail.com: domain of 3E8W4YQYKCJQ49612F4CC492.0CA96BIL-AA8Jy08.CF4@flex--glider.bounces.google.com designates 209.85.221.73 as permitted sender) smtp.mailfrom=3E8W4YQYKCJQ49612F4CC492.0CA96BIL-AA8Jy08.CF4@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1639499028-317233 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 21735829b860c..9620b5224754e 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -937,6 +937,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",