From patchwork Tue Mar 29 12:40:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12794796 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 1D855C433EF for ; Tue, 29 Mar 2022 12:42:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A49E68D0006; Tue, 29 Mar 2022 08:42:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D3708D0001; Tue, 29 Mar 2022 08:42:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89A1B8D0006; Tue, 29 Mar 2022 08:42:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id 7ADF88D0001 for ; Tue, 29 Mar 2022 08:42:33 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3F4ABA2B0D for ; Tue, 29 Mar 2022 12:42:33 +0000 (UTC) X-FDA: 79297387386.22.15D0638 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) by imf18.hostedemail.com (Postfix) with ESMTP id C35E21C0004 for ; Tue, 29 Mar 2022 12:42:32 +0000 (UTC) Received: by mail-ej1-f74.google.com with SMTP id do20-20020a170906c11400b006e0de97a0e9so3085045ejc.19 for ; Tue, 29 Mar 2022 05:42:32 -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=0QWUQ+RqE8jiHyj7/O+KujG6tRpsbOFA8yuMseJPgVs=; b=OfXq72ZoBUQGSWSvm4KVtJ07Y6J70d5V6dAjwsYPNQ8KvQs+UemAzoD9b+EXKX/OTw Q+izHPhM0oLIkOLIiuKDw0qaaM3HmxBX8q8lxNCUTVCL6uMVfLhs0yBqTwJyZYo3a2Dd PHMlh5zEbtKHkaJRb6sAKEdQbGhEcA7fqUGVsUSQYvLsCZPqYBZ6kCgNZI+IIO0DTiYw dKXtVOTB8fspK7u9aonJCNi788zBxPM+etWoLtYNpYHL5mhBEusrVsXgVIm9RsvEQvVL BVUcgD1GuztoqNHxl+h1HcQQt1n0AN97ckOSFFHrUUEbkVxi2NvTa3+e0HN0zz3+BFfO qT4Q== 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=0QWUQ+RqE8jiHyj7/O+KujG6tRpsbOFA8yuMseJPgVs=; b=FCZC254BtaCw7PFDaGwz2HZpiEH+idXIIedAfEvQp4fPBNkp3b5tVrwWCXhaU7GQdL Xcs7qgr+Jt1dEwHQ3PqqZ9YfMgGSBmD41VKn5lroAdC8rbjN/1EhJ5M6dtGN8PrTUfbm f6vIhnEVlVKiM43yL5YMMQd84lrzS+DvRjTSmQ+L+QPaCfMk4BE0F7ilpTXd4aLKx1FO mQK9xC01++8WCYh+uBAWW+pEaAORiQcCtjb1FVhB3V3Mhw0Ja+Q58VgiBrZO0txH7KFZ Qg8LYMbS307HN8CPsYyXqzcfHUhLmKU8oIRjtlrlUeHQQUiFnqR2VsR7niaupZ1yXg23 dKCw== X-Gm-Message-State: AOAM533Vh5sUbukRnI/se4QfcjsvWjWb1+EG6wsSOCcTZuQwlo78MBEy 3Ax/xi7hY6wbzWMmRqkyC6hVEpjP4G4= X-Google-Smtp-Source: ABdhPJytokWuo6v19GSWg2KLHdtKqtVYC2QIF6Shk0LT4bep8x7ZGLJY2F5r9sIe9kWDKcupdjioDqnZsL8= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:36eb:759:798f:98c3]) (user=glider job=sendgmr) by 2002:a17:906:948:b0:6d6:e479:1fe4 with SMTP id j8-20020a170906094800b006d6e4791fe4mr33417649ejd.240.1648557751382; Tue, 29 Mar 2022 05:42:31 -0700 (PDT) Date: Tue, 29 Mar 2022 14:40:15 +0200 In-Reply-To: <20220329124017.737571-1-glider@google.com> Message-Id: <20220329124017.737571-47-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 46/48] x86: fs: kmsan: disable CONFIG_DCACHE_WORD_ACCESS 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, Andrey Konovalov X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C35E21C0004 X-Stat-Signature: qgk8qoqjjskjip6t18bjqnnk33dwdr8k X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=OfXq72Zo; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3t_5CYgYKCNgAFC78LAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--glider.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3t_5CYgYKCNgAFC78LAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--glider.bounces.google.com X-HE-Tag: 1648557752-94888 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: dentry_string_cmp() calls read_word_at_a_time(), which might read uninitialized bytes to optimize string comparisons. Disabling CONFIG_DCACHE_WORD_ACCESS should prohibit this optimization, as well as (probably) similar ones. Suggested-by: Andrey Konovalov Signed-off-by: Alexander Potapenko --- Link: https://linux-review.googlesource.com/id/I4c0073224ac2897cafb8c037362c49dda9cfa133 --- arch/x86/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 86df15017f79d..646a7849be4cf 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -126,7 +126,9 @@ config X86 select CLKEVT_I8253 select CLOCKSOURCE_VALIDATE_LAST_CYCLE select CLOCKSOURCE_WATCHDOG - select DCACHE_WORD_ACCESS + # Word-size accesses may read uninitialized data past the trailing \0 + # in strings and cause false KMSAN reports. + select DCACHE_WORD_ACCESS if !KMSAN select DYNAMIC_SIGFRAME select EDAC_ATOMIC_SCRUB select EDAC_SUPPORT