Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5697635rwi; Tue, 18 Oct 2022 02:54:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hqn9p6Xyj/LvuidZDke9JgQko/lUx5Ah0SxXVba4BvN8rE21tZEyQ20al3jP8rzpTG2bi X-Received: by 2002:a17:907:86a8:b0:78d:b89f:937 with SMTP id qa40-20020a17090786a800b0078db89f0937mr1655023ejc.419.1666086881752; Tue, 18 Oct 2022 02:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666086881; cv=none; d=google.com; s=arc-20160816; b=T66/9OMb7enOiIOAhsdAl+vUvI8SnDtI7NHYCrZ7AEbY5r5j/LUdko6wHS4RD1I+I0 BSJIbmEv+lqt0SkJbK48ijAZDoFxGfLU/T2A8qz8b1jJwsXXKQvK8SYz4U3VV4WrLYCc EmXdsOQQFPjn2m80E+o1MNkPMGK3ljYUVOl1BozGKs64mtCBw1OrkczFEThUgupdDAx+ sdKj4YrDGzgjKaMg5LDmBepJ5wdw79PCgYM1YMuDscqQBDZ7d1BdPrYd5jatoTgazW2T 6o1s9/8tjDfzZ9zIxddllOBuoNLpnstoi9MAnf9AznuFTCtSmLcKNQcvsfQyHzgI5e2c s+9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=DU9aUKfe8YiSdBMpeyV3GLQ4rLKutE7C4dx+hv01OMA=; b=SwhTrUX35Kcs5XbmOyNdAfZUibRDBNy4VqKJIA+95SOHCH0pe+k9S2nvwiCA8gB2s8 JJvGmFQW6v8BS/nr/eQhaxQPVyhbEN2lJIlnVQys6Iojmr9yBCgaShk1urexq3bKmji2 KFHJ5HQVZdUUGlCjNB+BSXeWJBYwl79z6jVOQDpejumCvBBBP7nC9qQRLVOG6JJxJzI2 nbqMr+l1+rs9SBhPdJqnuZ4AzwUnOobZVu/HlBWhk32zYDQnbidJUYzmVAO6R8Gijc9y 467KGo6b9tzmMQTciIF+Y/huZANgVDJw/rRwbhQkE3P5xo/W32hEu21FTIiLPxOJ+7tp LBfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=D5kpcQm7; dkim=neutral (no key) header.i=@suse.cz header.b=GKP62Kho; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt39-20020a1709072da700b00787e1d77943si12702087ejc.49.2022.10.18.02.54.14; Tue, 18 Oct 2022 02:54:41 -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=@suse.cz header.s=susede2_rsa header.b=D5kpcQm7; dkim=neutral (no key) header.i=@suse.cz header.b=GKP62Kho; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiJRJYN (ORCPT + 99 others); Tue, 18 Oct 2022 05:24:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbiJRJYC (ORCPT ); Tue, 18 Oct 2022 05:24:02 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FA9EACF4B; Tue, 18 Oct 2022 02:23:51 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2796E2002A; Tue, 18 Oct 2022 09:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1666085030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DU9aUKfe8YiSdBMpeyV3GLQ4rLKutE7C4dx+hv01OMA=; b=D5kpcQm7hez0sNUS250ZsyzcaSWlOuOBwJG9lit3I05Nd/OiZUCYSlfz8zuR5p+jxXURLs wxle+PgXojzSsvryNl2RZQREddF9ApdaQyGwwfJuT2OdPsVmh9ces+hoqsZCc1kSN+w33w TiEBC8Bx7ifq2rCzB9KznbQz1XcaJto= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1666085030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DU9aUKfe8YiSdBMpeyV3GLQ4rLKutE7C4dx+hv01OMA=; b=GKP62Khoi8ff8rvlt5e3xjTGfC3MxZUlCsNI+gWmPw3lnmvdgAa52QxddcTrhgfbtYQsLq KEQx3IEuu25sIgBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6B91413480; Tue, 18 Oct 2022 09:23:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ghoWGaVwTmPWBwAAMHmgww (envelope-from ); Tue, 18 Oct 2022 09:23:49 +0000 Message-ID: Date: Tue, 18 Oct 2022 11:23:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH AUTOSEL 5.4 10/13] kmsan: disable physical page merging in biovec Content-Language: en-US To: Eric Biggers , 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 , Andrew Morton , linux-block@vger.kernel.org References: <20221018001102.2731930-1-sashal@kernel.org> <20221018001102.2731930-10-sashal@kernel.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 10/18/22 02:22, Eric Biggers wrote: > 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? No, AUTOSEL is drunk and should drop the random kmsan patches for random stable versions. > - Eric