Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5225456rwi; Mon, 17 Oct 2022 17:47:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PmHfPxaMgSO1XEfB43r2s89xtJZNQt81bP4g8m2doV4rcJGtVb0HNqUJyYYdhXJag3CZ2 X-Received: by 2002:a05:6a00:c8a:b0:563:8d31:879c with SMTP id a10-20020a056a000c8a00b005638d31879cmr511959pfv.74.1666054030915; Mon, 17 Oct 2022 17:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666054030; cv=none; d=google.com; s=arc-20160816; b=BPnprIUPO/FcW9xfRJ27LpoLgPRSplcd9y/y1Bs1sngP9aXfLvzaDHMHcA9tjX7dPS 7/tU7bk0qIktSqp5SqjtuzQ+6RYw7lIMrHP9rmf0tVpjuKoGsK0F3g38fjxgpfhUogB3 WWmAP7ADckEZ6jHESfTu7TLlCCLqhfQPQ67cMq/3zSmk+5cuz6emnbDEBWcHPjXebwb+ FTrWQ81qzaKpb4uz/5FY05iTgtoMDA5gGiiZ8hRj24q/It+6Te6KZwX2EldNdJaHpVnb n7t81/Pgc1OUT0a3X3fT0RdBbT/in997w0E9vdzq8shUnjh/rK6aemvhVVEmMhB6+SSp ZO1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y3rtkq/RHoM1dZxJE7pzN8YIwDLwc57//AU0MHlmwZE=; b=FGfZxMjrf14ym2b3M83nO/A6e6teAnwcd7d7ZeVwVL5Xh69bs26dR0b2VMhROQeioE 0OZKBeEMZ0AqNax5AkaeyOhjVBW1BNFfR1RB0ZpbFg6N3zUl0Lb68Jp2eb92At31tY9/ 8Sz6L/5cvT+VOZ+irm+axfCAy1ZFVSWQZnm9pfUhVog6VR9HXUgPY7t9LUMl9d5NRb8M Zq8U5jpIKNmtnSAAX/zetJvaNlVtMSpZT+2qMLa73IBrrjdSwAQZMBbh8FI7Q1fNyop8 IUcteHl+6XW5fP57o/+s8+EQKRFHYceE7dONKaORDx0vcOjyGjuTZivyHCsKZXTiHlAf PHSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dgU0FONr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl10-20020a17090b384a00b0020579d99c4dsi14923068pjb.138.2022.10.17.17.46.58; Mon, 17 Oct 2022 17:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dgU0FONr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbiJRAen (ORCPT + 99 others); Mon, 17 Oct 2022 20:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbiJRAeg (ORCPT ); Mon, 17 Oct 2022 20:34:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA70BA1B0; Mon, 17 Oct 2022 17:34:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3CC3B611F5; Tue, 18 Oct 2022 00:22:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F678C433C1; Tue, 18 Oct 2022 00:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666052556; bh=w8dO5flJtUJ9RxNmvELTwbRTnOO/jaWU4CHl6yTVTtY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dgU0FONrfUG14UKEzGn6NWQEdmezbNgsBKBMCAE84b4HSKux7d1CBg6+awMblpCJr b/dVyxnS6PRzGOX/bIZG2BEEQ6httxDRKW4lWTZLFVvcOIk+r9IF1JreiuEykWyTwL LohTR9JwZ9xeiYFZ5nlSTgMyfCmkhgv7SL6awThizNbNtlGjdipWYyCOHb7XCJoBTr AGYKljHxkFg6z5F3EqHUczqiZxed/czQkxuGWpeM8V39Ri9D8mXE6hSKCoubV+e2EN hIeVyo8877ZKZJJ8e7mU2+oTUR7ufsxBGWsHvJZIrgM0DWRb196QYpnAQ2a6bKl3aj QWQKsPeRTEl6Q== Date: Mon, 17 Oct 2022 17:22:33 -0700 From: Eric Biggers To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Alexander Potapenko , Alexander Viro , Alexei Starovoitov , Andrey Konovalov , 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 , Stephen Rothwell , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , Andrew Morton , linux-block@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.4 10/13] kmsan: disable physical page merging in biovec Message-ID: References: <20221018001102.2731930-1-sashal@kernel.org> <20221018001102.2731930-10-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221018001102.2731930-10-sashal@kernel.org> X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 17, 2022 at 08:10:59PM -0400, Sasha Levin wrote: > From: Alexander Potapenko > > [ Upstream commit f630a5d0ca59a6e73b61e3f82c371dc230da99ff ] > > KMSAN metadata for adjacent physical pages may not be adjacent, therefore > accessing such pages together may lead to metadata corruption. We disable > merging pages in biovec to prevent such corruptions. > > Link: https://lkml.kernel.org/r/20220915150417.722975-28-glider@google.com > Signed-off-by: Alexander Potapenko > Cc: Alexander Viro > Cc: Alexei Starovoitov > Cc: Andrey Konovalov > Cc: Andrey Konovalov > Cc: Andy Lutomirski > Cc: Arnd Bergmann > Cc: Borislav Petkov > Cc: Christoph Hellwig > Cc: Christoph Lameter > Cc: David Rientjes > Cc: Dmitry Vyukov > Cc: Eric Biggers > Cc: Eric Biggers > Cc: Eric Dumazet > Cc: Greg Kroah-Hartman > Cc: Herbert Xu > Cc: Ilya Leoshkevich > Cc: Ingo Molnar > Cc: Jens Axboe > Cc: Joonsoo Kim > Cc: Kees Cook > Cc: Marco Elver > Cc: Mark Rutland > Cc: Matthew Wilcox > Cc: Michael S. Tsirkin > Cc: Pekka Enberg > Cc: Peter Zijlstra > Cc: Petr Mladek > Cc: Stephen Rothwell > Cc: Steven Rostedt > Cc: Thomas Gleixner > Cc: Vasily Gorbik > Cc: Vegard Nossum > Cc: Vlastimil Babka > Signed-off-by: Andrew Morton > Signed-off-by: Sasha Levin > --- > block/blk.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/block/blk.h b/block/blk.h > index ee3d5664d962..3358ef4244fe 100644 > --- a/block/blk.h > +++ b/block/blk.h > @@ -79,6 +79,13 @@ static inline bool biovec_phys_mergeable(struct request_queue *q, > phys_addr_t addr1 = page_to_phys(vec1->bv_page) + vec1->bv_offset; > phys_addr_t addr2 = page_to_phys(vec2->bv_page) + vec2->bv_offset; > > + /* > + * Merging adjacent physical pages may not work correctly under KMSAN > + * if their metadata pages aren't adjacent. Just disable merging. > + */ > + if (IS_ENABLED(CONFIG_KMSAN)) > + return false; > + > if (addr1 + vec1->bv_len != addr2) > return false; > if (xen_domain() && !xen_biovec_phys_mergeable(vec1, vec2->bv_page)) So KMSAN is being backported to 5.4? - Eric