From patchwork Fri Aug 26 15:08:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12956212 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 791C5ECAAD6 for ; Fri, 26 Aug 2022 15:10:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 157D3940013; Fri, 26 Aug 2022 11:10:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E0F3940007; Fri, 26 Aug 2022 11:10:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD930940013; Fri, 26 Aug 2022 11:10:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id CF351940007 for ; Fri, 26 Aug 2022 11:10:03 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AEC47160E99 for ; Fri, 26 Aug 2022 15:10:03 +0000 (UTC) X-FDA: 79842079086.30.CF76409 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf11.hostedemail.com (Postfix) with ESMTP id 507FE40014 for ; Fri, 26 Aug 2022 15:10:03 +0000 (UTC) Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-33d9f6f4656so29463707b3.21 for ; Fri, 26 Aug 2022 08:10:03 -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; bh=4pDNTP8Rcz1c/6m0qOjb0X1O42ovrN3YaDrJNkQcLng=; b=D8g9K+F2VtTbVGCiyA3gHOZ8vWyfLv3kiBVO8NzVmbbuaiAQz5lidowjJcTUnqN9NV 0M45L50FmJ4PxOKToUEzR27CpoNoU/oyH1Qxm5OUEXk0XU/8/XXprRa1vk5Bi3TeJfkw q081N/bHUsn7mQv/yoQ1Ey2nzz9m+S9Fo7PM6zBWmqx38XFTQk025tvKxOEGgVZjqGty /9F1JErkTDPulPdl0zxIDtlkVyQUOPBuGPdH9gBMfPQwL19d8No0nlzWwOQohCYKDZm6 MPulEwsqymX7KjroU/sIuuObTC/BUFlxcZTS2qy9QDHhU8TveQCUg6HprGxaMBW2ev2v GJow== 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; bh=4pDNTP8Rcz1c/6m0qOjb0X1O42ovrN3YaDrJNkQcLng=; b=Kc4vpwLLZ8ulos9kOiqSPFWTJbjsP0YM6xNzLBou9Et8ueOB4Rio/xlFMKvfbVYqGz V5q7AuEmxX792YICrEj9BoFDPrmyBXZaWuWuRJRKMAHcae+wteVGqUr75NOjTNUIw4b9 qhpuVt1LAaGzQTmKb0GntbwXU6Ne6+JqTcWxjVjas5A3mixLnpphbsBWqBo2KlHvxvrz c4wv+A1MlBA+REzgJb+288bDd/n2iSOwqlF81LXEfowMFj3T6T6LRJDyiZMhben8oEIR rPOq6RW5PNlelh+1Gf1QxSmclUMN+V1TW8/b+U9MxZM0Q4H/q/dfkGXL0hBQUXqRguDQ vG8g== X-Gm-Message-State: ACgBeo3m4sTQrdbS2/yCfrrK/GG9rTplW7w6+B+Gs6+SxXTRg0UeMuRo aEtDoxZ/H3+c7UV8RCaoLcfSQ51CmvA= X-Google-Smtp-Source: AA6agR5vVQmtlhIgTKQ7dnFjHT2Qul1eY6YRiLp6VijdR+cm0ab1oQKWZ6dDBOhtA58d0ZDce6nTKPF8G7g= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:5207:ac36:fdd3:502d]) (user=glider job=sendgmr) by 2002:a05:6902:10ca:b0:671:3616:9147 with SMTP id w10-20020a05690210ca00b0067136169147mr92484ybu.105.1661526602616; Fri, 26 Aug 2022 08:10:02 -0700 (PDT) Date: Fri, 26 Aug 2022 17:08:02 +0200 In-Reply-To: <20220826150807.723137-1-glider@google.com> Mime-Version: 1.0 References: <20220826150807.723137-1-glider@google.com> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826150807.723137-40-glider@google.com> Subject: [PATCH v5 39/44] 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661526603; a=rsa-sha256; cv=none; b=qimphwSapwpv+6t0pstxhAB423Q+NVGAaFjbqngjba53oOgIqSLHbD2uP3fy1rw2/zkDHy G+m9RrKvBQlziYrmNR3OcgAHBM1qAwt3uUBvcQ9BiFuvqT1naePnksI7giiSCXi5N3vOVY XKOaqwO5T/StH23M5+hvhmhNHSluqFg= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=D8g9K+F2; spf=pass (imf11.hostedemail.com: domain of 3SuIIYwYKCFEz41wxAz77z4x.v75416DG-553Etv3.7Az@flex--glider.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3SuIIYwYKCFEz41wxAz77z4x.v75416DG-553Etv3.7Az@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=1661526603; 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=4pDNTP8Rcz1c/6m0qOjb0X1O42ovrN3YaDrJNkQcLng=; b=seeKYHVaHa91/3cjC2344Y9XOLX1U9pyuMA4EUhaESEBHpMxR20Ik1oO4dchb6L9RPdkMM hhJudyJ6+ddb8ufiMNxfqvdtExXFFwwz5YtJEZCotlzUVGO28c/8G0BLOMTXBHhFUcVFbG hWxam7RfpaAlCEB7wEcdaInDZpFvBAE= X-Stat-Signature: gc7x8r6z864qqqwqei6u59g1hue164po X-Rspamd-Queue-Id: 507FE40014 X-Rspam-User: X-Rspamd-Server: rspam06 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=D8g9K+F2; spf=pass (imf11.hostedemail.com: domain of 3SuIIYwYKCFEz41wxAz77z4x.v75416DG-553Etv3.7Az@flex--glider.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3SuIIYwYKCFEz41wxAz77z4x.v75416DG-553Etv3.7Az@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1661526603-527102 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