From patchwork Thu Sep 15 15:04:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12977556 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 860C1ECAAA1 for ; Thu, 15 Sep 2022 15:06:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 194168D000C; Thu, 15 Sep 2022 11:06:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 145778D0001; Thu, 15 Sep 2022 11:06:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F008B8D000C; Thu, 15 Sep 2022 11:06:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E25988D0001 for ; Thu, 15 Sep 2022 11:06:23 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BD97C404DE for ; Thu, 15 Sep 2022 15:06:23 +0000 (UTC) X-FDA: 79914645846.22.BA58A62 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) by imf16.hostedemail.com (Postfix) with ESMTP id 6244D18009B for ; Thu, 15 Sep 2022 15:06:23 +0000 (UTC) Received: by mail-ed1-f74.google.com with SMTP id z2-20020a056402274200b004516734e755so10673057edd.3 for ; Thu, 15 Sep 2022 08:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=y7GARGHGPpfPMqaRIp9ae7D7QgvYSCiDFPeV4nzQ3Rk=; b=Ebn9L6x3k72Uf16Z2sPPbKumL6GMhSFgPt5NQNEYRWzTnLrilf1HFYWiSYnGpWzKmW FEA3UcFlSfNBEEl2K81EZ6eD7aiI4y5Lge5FU9eykMyCjFPvzA0OERI5NU1y7iIqzH4v c4bqIf2YXdWDqpJ7Z98p9HtPqrsdglQg7fUxhuQ3RQxCmBMtL3Ay3m/RSRRMUnT3krI/ r/DchyRFkiNefRiT2e63g4k5RSo2Hy1Ol6ONeQh8mlWGT0TsG9D5zangksZzjs93TeC9 m0QqPsGp0C4MAjpxPDWCraRdWM3NGQnNaRKZeuadbrgwNxMDa2D0sDAXU9zdGMOwMd5p 3N+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=y7GARGHGPpfPMqaRIp9ae7D7QgvYSCiDFPeV4nzQ3Rk=; b=KUyP6C3JUB4oDjEBX9q6giyBz0Z9KBtWvPrOwAdQAXcg8FM91yLUB6zLr5OJkG50ca 5gtMs0S5fkAKLfwUv6iQ20cELQDh2v08mmYIBQoabeHk4bvm6VE6kIUio1yWmt4Yr0ih jK8QqtJV1IYEEaZFPGCb0uqgvkOf4ff/ETVINdH9AlXkPl5j7xvUQEJtWaObwy/OOdjj oZQfViMxEi4JVhz8tEfkQ80O0wExbv0Mp56OEnm11NimCE5YnIobYLehq3LLR090fIJM aDQTG/nQX8Y2MnTJXyaRLMAUAjSC0f8zCvWaNc9V3Wpg7aYYLEdBawMbwIpILMgQEF43 CAfw== X-Gm-Message-State: ACrzQf1wIdB4tBt6bvSt2TPXTDhKr6gTyYa16MQuOhg3OZoH1Wa8GClE 6YQ3C1yLC8JTy8uq89w7Lr2PEDUDRHE= X-Google-Smtp-Source: AMsMyM7TbJseKEuaq1ed2Qlb9dHi6cPdzHSmcROd4iSHRPNQzeNqnCIZX7H+dXJZfaek8LGd/2MCvKxWIXM= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:686d:27b5:495:85b7]) (user=glider job=sendgmr) by 2002:a17:907:75ee:b0:77b:c559:2bcc with SMTP id jz14-20020a17090775ee00b0077bc5592bccmr266153ejc.537.1663254382083; Thu, 15 Sep 2022 08:06:22 -0700 (PDT) Date: Thu, 15 Sep 2022 17:04:12 +0200 In-Reply-To: <20220915150417.722975-1-glider@google.com> Mime-Version: 1.0 References: <20220915150417.722975-1-glider@google.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220915150417.722975-39-glider@google.com> Subject: [PATCH v7 38/43] 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 Biggers , 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 , Stephen Rothwell , 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663254383; a=rsa-sha256; cv=none; b=n1PtCTFxHEdyf0fcnG+VHceUsfNuYd25kot/EUsygM04WpuD63b8s2TZwBEYMxUEMz9hBD 5MfwCYlaV2WFAQjp1MOhF6Lw295RSAU738AbRqAOFujxier+SUV1P7ke0KYEC6SZzTRFsf PTfQOSq9+23RMNC92WsVeiABq6oL4bM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Ebn9L6x3; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of 3bj8jYwYKCJk9EB67K9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3bj8jYwYKCJk9EB67K9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--glider.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663254383; 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=y7GARGHGPpfPMqaRIp9ae7D7QgvYSCiDFPeV4nzQ3Rk=; b=Iuf5mqdFH064mjob6zb9khl4znJd78VrsjvSRyiL8EP7voQW1t8JEvVXk0fDdx9h0IBEGf NYuD7JKFlHYQLbFC+zHtukOtl4Tt73HLV3xpwvU5gGWMjbxgeUVZpq2D3YGapp07zW7U5/ VmZX1HRUNq2MTqfsEo22mh4f5krrVLk= X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Ebn9L6x3; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of 3bj8jYwYKCJk9EB67K9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3bj8jYwYKCJk9EB67K9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--glider.bounces.google.com X-Stat-Signature: utex86kswxoso9hk1b4utwk9sw4qz3wx X-Rspamd-Queue-Id: 6244D18009B X-Rspamd-Server: rspam09 X-HE-Tag: 1663254383-783721 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 33f4d4baba079..697da8dae1418 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -128,7 +128,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