From patchwork Fri Jul 1 14:23:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12903396 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 AC2E5C433EF for ; Fri, 1 Jul 2022 14:25:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44DE76B007D; Fri, 1 Jul 2022 10:25:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D53B6B007E; Fri, 1 Jul 2022 10:25:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29D106B0085; Fri, 1 Jul 2022 10:25:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1A9006B007D for ; Fri, 1 Jul 2022 10:25:07 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EAB2333AC8 for ; Fri, 1 Jul 2022 14:25:06 +0000 (UTC) X-FDA: 79638753012.26.5219171 Received: from mail-lf1-f73.google.com (mail-lf1-f73.google.com [209.85.167.73]) by imf24.hostedemail.com (Postfix) with ESMTP id 7E1FB180047 for ; Fri, 1 Jul 2022 14:25:06 +0000 (UTC) Received: by mail-lf1-f73.google.com with SMTP id b2-20020a0565120b8200b00477a4532448so1188074lfv.22 for ; Fri, 01 Jul 2022 07:25:06 -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=MLo3LhenoRrRqNTI2r4mtWD3J0vGsm9bvjleadBpMkY=; b=anOUkKWtulGEKBkArfZgJyNh0cGJx9d7Cq23k1uQwOBaeBk8BsWD249jvt+waaUJ0W wFq6nFfeaRMqhTZBfdHnekYcU9Y6DlOKwhd7zz8Pwv5Mf7POcnXxXlRO9IdWwc7sHxG8 EJehSvYRYGgoI66twoBlGoYEACzjwkAkNmneLnfsKkPQFvcZRfWhgQAodIu6D09PjFk8 Icdf6H3+rBIz7HcFSJ3Z9tX02BV8EOgwwt+6yOVuoCYfJOPeNjzAXzZ5xayTIEyTNe+u 12rzA9yQKhB/zdr6mRJsJWTzWXROIdNbnWlGX7VZEuLugd3XmFTzxEYhZNDwatZ7SBn9 IL1g== 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=MLo3LhenoRrRqNTI2r4mtWD3J0vGsm9bvjleadBpMkY=; b=vro+b7/dWbtMDEUQXEXM1xz6sghV1SBjbpzs2XX7PJ7qMBb/12vcKkgwUo16PUOPs6 1J2mjTx58y7LzGgtdUxXf1/ebgEjeKcDLgvXBCluilq9ki4NHMfN6avvuCSkwilMzr6P k2CbtOrdGNRKNnhc0hNimrGsYqgiyRjD7CgYCSp+nqzNvQyxb7LXYmtM5oNbH0lollD8 EsAHXVg9tcH7doveou/5xX6R0h/xIlD1FRbzOttgycntIHOcXIfBhaRiZ+zJJ5brl30X d+uNlcQ10u8dtg8KhC7nzGoSxUElyfebU7HvFmS7Ve0hn4S4fexjAMTEumTQVpJS9SKP 9LOw== X-Gm-Message-State: AJIora+hKQo9hzPbtUnqKgNARhDM8yiCaUxxhTPP89y2tKkDUIT+hL3m AVoS2Q0VLwM7L17/HC9UT/T9OYF5yzI= X-Google-Smtp-Source: AGRyM1vhkmL+KohFz0MszVF5zMXVYF2SuHbeJwCxM549Y5UN3wtICSWeskVNj4IhdECyposUmY2NkdReg2A= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:a6f5:f713:759c:abb6]) (user=glider job=sendgmr) by 2002:a05:6512:e83:b0:47f:635c:3369 with SMTP id bi3-20020a0565120e8300b0047f635c3369mr8918326lfb.659.1656685504982; Fri, 01 Jul 2022 07:25:04 -0700 (PDT) Date: Fri, 1 Jul 2022 16:23:04 +0200 In-Reply-To: <20220701142310.2188015-1-glider@google.com> Message-Id: <20220701142310.2188015-40-glider@google.com> Mime-Version: 1.0 References: <20220701142310.2188015-1-glider@google.com> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [PATCH v4 39/45] x86: fs: kmsan: disable CONFIG_DCACHE_WORD_ACCESS 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, Andrey Konovalov ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=anOUkKWt; spf=pass (imf24.hostedemail.com: domain of 3wAO_YgYKCN8HMJEFSHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--glider.bounces.google.com designates 209.85.167.73 as permitted sender) smtp.mailfrom=3wAO_YgYKCN8HMJEFSHPPHMF.DPNMJOVY-NNLWBDL.PSH@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=1656685506; 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=MLo3LhenoRrRqNTI2r4mtWD3J0vGsm9bvjleadBpMkY=; b=4hLODbWvLGyflZCLkxEjYRtxQlkDRxpAIYWR9upGm2IuORv8aZ8ayw/eSxiRrN9mTXYcqN 8QL3yHIeUiRXlQaF5lJJtx9XoCT+YN13ZkLLvMlFk1l5hBh5q+5ElprXJHBwPyiXKMkIER la3jVs2Blr2uT1xBRB8xSyQmQ5HDnfA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656685506; a=rsa-sha256; cv=none; b=qEsUKrWKCVwpx0rPIIf15eVVNsfQB/NiydbCvu1hffLI5luPdeWs1ucoZoVuBTJ+fHtvjF TpTjKBiz16vWZmzfSlO9s30puyMZL5Zoa71zcPSlbGLPhTWIpuF0csbL0umYni0gpOz95t 3tUMOKU0ln7dd/xRtpSoIiAbWGErCsg= X-Stat-Signature: tn61cbfg1yr3qaebi5ngm37id8abm44n X-Rspamd-Queue-Id: 7E1FB180047 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=anOUkKWt; spf=pass (imf24.hostedemail.com: domain of 3wAO_YgYKCN8HMJEFSHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--glider.bounces.google.com designates 209.85.167.73 as permitted sender) smtp.mailfrom=3wAO_YgYKCN8HMJEFSHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1656685506-518721 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 4a5d0a0f54dea..aadbb16a59f01 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -129,7 +129,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