Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1249495imw; Tue, 5 Jul 2022 06:25:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sppPS59GRSFNYYVmO+lfT+X9N80L4AlGLz8/ClrDrXvXpHbMnowUP3/V9st/HUryenYmse X-Received: by 2002:a17:902:778e:b0:16b:c4a7:7e8d with SMTP id o14-20020a170902778e00b0016bc4a77e8dmr21876222pll.86.1657027525170; Tue, 05 Jul 2022 06:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027525; cv=none; d=google.com; s=arc-20160816; b=RjYgRQKzJ9ZT7foOD/pKuusMF2G8srN5EE9cIFPsu8zofpvWx9psALUEvYmQ5H+ULp mvTbVUSjuBFfNPt4dTY4g28hZtT3t4FGvHf1OnGBneAxwMJLY/kcpy/9Wc089nrDiIlT 20DSl8ToOv5X/VeUcKhDft7jwA6X18qSc4kFIOAQFshC5n7rv/dkncyArP1TS/EiaXGi nXpYDuK79ma6/UBlQZ6i2FwtCvUIlIIMZuPYLatp67I2t6ORQDClGJq0Rx2bBbTx8zgo 7g1mKBBDzxGqKMEcfbM/sRwSQzJ8nzoZYh4WCzUUBCyYfFgmAkU3aIu2XWpnaTmt7wZ9 GwjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3SxOngWdT3ISCpd2aVg9IxIt7B8mczuNQ7W9TeIkpg8=; b=hkAqt1vR3e/2pu3i8ybPOlVcLphHY/pafvjjJBlRnfZ0UrFbSpyjEevNJURBsakawe YAD7S/61CEGYudk9C5xJfMjxqmbXkz+DNKuB6oG8sprHeZet2mJ9NJiWlJlDmKPXkaiA PWAXdJ7tbeOdZBn0dnzS/gLLnWTQsEecEAQVM5FJ4em8iLJd5D8PeFWZuWc51gZ2G3fD IBXk90mphVX5no7PJCEdyfGptly0lUznfy5m93uSeQFMS5nAIrNCFCObOPoln3zB5+CO JeUeLT9cjdPRxnzInnEOuRSWUoZP/MvVcXwnKCwcH0kJcbM59RorCGPXkLSSlyAZuVOh mAUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CCrXZKsD; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y32-20020a056a00182000b0051bd440b069si53932780pfa.14.2022.07.05.06.25.13; Tue, 05 Jul 2022 06:25:25 -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=@linuxfoundation.org header.s=korg header.b=CCrXZKsD; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238062AbiGEM11 (ORCPT + 99 others); Tue, 5 Jul 2022 08:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237054AbiGEMSk (ORCPT ); Tue, 5 Jul 2022 08:18:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1413E1A806; Tue, 5 Jul 2022 05:13:55 -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 9EF3061988; Tue, 5 Jul 2022 12:13:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FCDEC341C7; Tue, 5 Jul 2022 12:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657023234; bh=O17ehTDfhjE4F+lUosr/S96RFM/locaGX05TwGTLqUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CCrXZKsDj1r98aqoIrMOwkCaoAI9V5lL7E4BOcvgeaiCfl/1XQAExWRksYwRBjctR mGdShPRcJaGzbe8Ku+APwtY7I1ZRQAvKSoWQAIlJwgn7gxT+U3PszU1kSRiZpF8gUw OS0mlL2F2qVqxxz6MTDWFFNfu3qJ0gD7EM1tiM60= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jan Beulich , Juergen Gross Subject: [PATCH 5.15 78/98] xen/blkfront: fix leaking data in shared pages Date: Tue, 5 Jul 2022 13:58:36 +0200 Message-Id: <20220705115619.788036686@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115617.568350164@linuxfoundation.org> References: <20220705115617.568350164@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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,T_SCC_BODY_TEXT_LINE 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 From: Roger Pau Monne commit 2f446ffe9d737e9a844b97887919c4fda18246e7 upstream. When allocating pages to be used for shared communication with the backend always zero them, this avoids leaking unintended data present on the pages. This is CVE-2022-26365, part of XSA-403. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- drivers/block/xen-blkfront.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -312,7 +312,7 @@ static int fill_grant_buffer(struct blkf goto out_of_memory; if (info->feature_persistent) { - granted_page = alloc_page(GFP_NOIO); + granted_page = alloc_page(GFP_NOIO | __GFP_ZERO); if (!granted_page) { kfree(gnt_list_entry); goto out_of_memory; @@ -1692,7 +1692,7 @@ static int setup_blkring(struct xenbus_d for (i = 0; i < info->nr_ring_pages; i++) rinfo->ring_ref[i] = GRANT_INVALID_REF; - sring = alloc_pages_exact(ring_size, GFP_NOIO); + sring = alloc_pages_exact(ring_size, GFP_NOIO | __GFP_ZERO); if (!sring) { xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring"); return -ENOMEM; @@ -2209,7 +2209,8 @@ static int blkfront_setup_indirect(struc BUG_ON(!list_empty(&rinfo->indirect_pages)); for (i = 0; i < num; i++) { - struct page *indirect_page = alloc_page(GFP_KERNEL); + struct page *indirect_page = alloc_page(GFP_KERNEL | + __GFP_ZERO); if (!indirect_page) goto out_of_memory; list_add(&indirect_page->lru, &rinfo->indirect_pages);