From patchwork Tue Dec 14 16:20:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12676367 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 56E5EC433F5 for ; Tue, 14 Dec 2021 16:32:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C2DF6B0095; Tue, 14 Dec 2021 11:22:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 372266B0096; Tue, 14 Dec 2021 11:22:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23A516B0098; Tue, 14 Dec 2021 11:22:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 151726B0095 for ; Tue, 14 Dec 2021 11:22:58 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C71E0180DA19C for ; Tue, 14 Dec 2021 16:22:47 +0000 (UTC) X-FDA: 78916918374.15.B8EA9B6 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by imf06.hostedemail.com (Postfix) with ESMTP id 99A4E180013 for ; Tue, 14 Dec 2021 16:22:46 +0000 (UTC) Received: by mail-wm1-f74.google.com with SMTP id n16-20020a05600c3b9000b003331973fdbbso8130362wms.0 for ; Tue, 14 Dec 2021 08:22:47 -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=pDpFAq/kgLbL4mZTug/Zn/jZQvoibLkfmHC/vYYPKLY=; b=V6TLCTroMQ1YFeJUAuCxWCM8TfORF5zXzcc4ylqnnnUmQFBR0wkShjX3TJqpedLfoJ OhGXscqmWNGR3eRaLf8qdFbwlf3KhIX0EiqDRTN8sJuq8UUzEnWhnr5dTFLKiyXS6X2T sIPx9Sbr+F6MfZddMdDtG76pRYMoFyVl7xP2sc3dWOPGAIQl/vWIKp5uvz26MCsufIC8 D5t9esKWY42zFJ+INBQpNQr3Zq9zBsN5DOTYEB6P/fW2+gp6TbhSXY7HXXs2KYyuG8Wu 3Ad+I8gxvLI3sfzZkkglyYeUQ55b52BS6bBCkBjRSFvNDAzqQvwiBjzOqMH9VhpVlD8X kS7g== 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=pDpFAq/kgLbL4mZTug/Zn/jZQvoibLkfmHC/vYYPKLY=; b=JLXfCJPHOMeGyXj1XkwlRaSsCFlAWzgxx6z8NiAJOdBcR4xa02QtBER/wKaa7cIpWc oa6V6smuDs908NoQTw+9sS0Ll0ghB/2zpCnzI5dGsIEWtHrIh86SHucWBBtYteyMESCP DS3Bb2BCqDhTxXEFuJCjXSX3J6uXqXM6dbnLPy3/0th21aHbh/kr9IL5a5qSzUKpI5IW g4+wZshbQIKYMjNeSLLJYl4jFeF0cwKMotdb8vVM7rawaJw2RsQT4An162F23p269fxj AFAhw7qY58RLm0+dKhaPkugWHYGjfRByncWL/ouo+4cCsay19WiaBh45XIxckF4m8W2y 8qHA== X-Gm-Message-State: AOAM5339txm/Cxd3TJsRf6rztWtKFzpxZYlzVwnEx5zR80YkyoQu0xyR waeI2hIT8/KTqM77yU0wvt7dUPW7JuI= X-Google-Smtp-Source: ABdhPJz5liaqc6HieOETlQr+PtYSR7daCRhoU6NJ7zV/jC4EZ7e8Cq5zAy4tyC1sowvOKbwx+OaMmBwZf9M= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:357e:2b9d:5b13:a652]) (user=glider job=sendgmr) by 2002:a05:600c:1d1b:: with SMTP id l27mr5819167wms.1.1639498965316; Tue, 14 Dec 2021 08:22:45 -0800 (PST) Date: Tue, 14 Dec 2021 17:20:26 +0100 In-Reply-To: <20211214162050.660953-1-glider@google.com> Message-Id: <20211214162050.660953-20-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 19/43] kmsan: init: call KMSAN initialization routines 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-Queue-Id: 99A4E180013 X-Stat-Signature: 63qd8u9tyu3z5ou86cxnwh5ffse7e54s Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=V6TLCTro; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 31cS4YQYKCFY49612F4CC492.0CA96BIL-AA8Jy08.CF4@flex--glider.bounces.google.com designates 209.85.128.74 as permitted sender) smtp.mailfrom=31cS4YQYKCFY49612F4CC492.0CA96BIL-AA8Jy08.CF4@flex--glider.bounces.google.com X-Rspamd-Server: rspam11 X-HE-Tag: 1639498966-382255 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_initialize_shadow() creates metadata pages for mappings created at boot time. kmsan_initialize() initializes the bookkeeping for init_task and enables KMSAN. Signed-off-by: Alexander Potapenko --- Link: https://linux-review.googlesource.com/id/I7bc53706141275914326df2345881ffe0cdd16bd --- init/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/main.c b/init/main.c index bb984ed79de0e..2fc5025db0810 100644 --- a/init/main.c +++ b/init/main.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -834,6 +835,7 @@ static void __init mm_init(void) init_mem_debugging_and_hardening(); kfence_alloc_pool(); report_meminit(); + kmsan_init_shadow(); stack_depot_init(); mem_init(); mem_init_print_info(); @@ -848,6 +850,7 @@ static void __init mm_init(void) init_espfix_bsp(); /* Should be run after espfix64 is set up. */ pti_init(); + kmsan_init_runtime(); } #ifdef CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET