Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1256902imw; Tue, 5 Jul 2022 06:32:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uykCjzSgX+zLRjcQTsQZwh9EVmxm80CNNxbMA5iJmhzlMcrSYcStDrxBt1ags0gtSKBOFW X-Received: by 2002:a17:906:dc8c:b0:726:e51b:d5c3 with SMTP id cs12-20020a170906dc8c00b00726e51bd5c3mr33178893ejc.369.1657027927479; Tue, 05 Jul 2022 06:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027927; cv=none; d=google.com; s=arc-20160816; b=ZkpJfUXQ96UiPcAv7oD+jnsdYdR8PXR6+Dq3nKL7DOO2AUXmr1XrtgZIoL8b68KZCJ oKy2Mi691GcDKEWcdg9DfSRXcrFXel87S/peYD7n1NOMj5dFr5IWL/UBMHN82Dtv6K9X lzVTfTzwWRu75r96Vk0mD013SIImggqVeufZywAQlkGOc1JNsM3NMlUEoKwvgVfBck7q zy76REuEix5RZcnBkoZqZxuT8VWC+THB7XjSyOzjOWdSOPu9sSCF05yYd8y8ohOltdeW oq/7JQ5m1BKCMzPDCKxLoo4GtVBD9Tj92Mz41XPxtf9dc1DgpA35ib9IWlbynaeYXvIa HB8w== 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=vB1rlwcdFPMfZPuZDMLhat013AjzyRkVuA7t7/aJ/Q4=; b=BkBFPZWUo+m02veK2zw5RcaeYyFRXc7NoGxmt0JYvyHR5UEvk6L7IPw6F5wE+BuI5D 4FTXr5PjgyCeuOhXcKI724XthHEVHmAnBT4G1ImErvJf6dXOjz50O0eb5/l8q7h5JHJo KMmtRvVhFPRes9fTBHhJst7t6DPyjGDE35e9bZW6+tNmiV7Tjvj5MhQ2Lu3LdhPEU1LJ ncXIAfnuEMrC5MbVz9dYPXpGEtnY2ki8/cWGa1VeLWs+7HS4nuDRN0V+sEAqFx1UcAhC pkDQ0Ji45spQOsZei7Bdvt+EHgcsXkMp/xLX3hJIOHQGb5p981VuPpR/vlHQOf1Wqz+l aSRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xn6U8MVL; 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 nb7-20020a1709071c8700b0072636d48d28si6474281ejc.453.2022.07.05.06.31.39; Tue, 05 Jul 2022 06:32:07 -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=Xn6U8MVL; 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 S234042AbiGEMFr (ORCPT + 99 others); Tue, 5 Jul 2022 08:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233551AbiGEMDX (ORCPT ); Tue, 5 Jul 2022 08:03:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4345B25; Tue, 5 Jul 2022 05:03: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 3BCDF61830; Tue, 5 Jul 2022 12:03:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F454C341C7; Tue, 5 Jul 2022 12:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022601; bh=IWKfm8F1cPA6juHn4lr3qCQxyVHdxkVKzToPP41rfm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xn6U8MVLoC5rFciavy86A93gWZBTc5Tlt6pjsfEwsbizZGNPhze/DsCLTGG6p79Fz Ny/jo/bE6EN6ijEloRNBpAmjufPjt7BSbsIE3IS8rSvE6oXe41mmkKo8FSGy6hGAXR euMYG06ZGhggjEs+bOQ5/c5L/PRr9Vi3bzBQjzqE= 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 4.19 27/33] xen/blkfront: fix leaking data in shared pages Date: Tue, 5 Jul 2022 13:58:19 +0200 Message-Id: <20220705115607.508870288@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115606.709817198@linuxfoundation.org> References: <20220705115606.709817198@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 @@ -301,7 +301,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; @@ -1744,7 +1744,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; @@ -2283,7 +2283,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);