Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1247381imw; Tue, 5 Jul 2022 06:23:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8S3zJGIgwn8s2ezGRDK/wj1u1Uf31Ep95jD/lDDd7Rr1duPtc2UtUnj2w7UGdv2ERmks7 X-Received: by 2002:aa7:c45a:0:b0:435:d7a4:99bc with SMTP id n26-20020aa7c45a000000b00435d7a499bcmr46176544edr.158.1657027394065; Tue, 05 Jul 2022 06:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027394; cv=none; d=google.com; s=arc-20160816; b=Vl+E2DDtlTj+9LbEE6cblyt2YKT9D8ncHUF/dQY0rvc3jkLRmSE9htGPQnvoAP9tPn UB5WFBGPDJOTzBwyO5loAwGQ9aijnDzLHc3GN8cKyqm3a8LHaHYRld0OZPDOlecw0Rv9 ii8G13yBOrEDrK5tR4blIT47N7ZlYdTjUI0mgUIObYMj/+/3aWkLHpZg8Yuhv7ht4oK+ K/bXWmnf7R4U4b/yIq4DL2HpEOrsX9V2/damSryUykPSUWXNpytk8H70o8RHxtKX3cEE x3LkI9VLuUGNRNU5dN3V34GMHPZ+fklfQiVkvUGOCKEj4b08TQ8QVAj77Z+bKOs0t2/F Zkcw== 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=tSyA/q6kvbF6FeDcVTUuFPlCRaqfWy36FOMpEMOmhuw=; b=N0Wr1uQJnK1KW+Bql/i4mp66hJtuP4W7+1m3QAV2H1Zt1kH95SDx8qelXwk59mtnPF WmH8JsYEvspdA0WawLbYeA63RKG+7Oew4aeK87dNdoE3Sx5A5SySGLv+jkhM5FZIb3XH xL8nqVkvPumYdTkuDsTNsDVF971OlLBMQ81UYTpGpWR7uZUfJ5i6fYbLW+gK9PWKbz4B LTFG9gxKLA9iqmZ/OB9XpMhjFyWp49vQfOX/W1n3TDxK0iMestj0Y/fC0K7KHgvnLhmr qkuRHBDeJdtejnx+PBN1AtP84os3XbaNIShGYU6rStVmruRMdi52jtbQCfciC5hFthNx mc2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d3JncEp1; 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 g16-20020a1709061e1000b006feb18c72bfsi9968106ejj.126.2022.07.05.06.22.49; Tue, 05 Jul 2022 06:23:14 -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=d3JncEp1; 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 S232833AbiGEMAO (ORCPT + 99 others); Tue, 5 Jul 2022 08:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232622AbiGEMAE (ORCPT ); Tue, 5 Jul 2022 08:00:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF0217A9C; Tue, 5 Jul 2022 04:59:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6B227B817D2; Tue, 5 Jul 2022 11:59:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1FCBC341C7; Tue, 5 Jul 2022 11:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022395; bh=jmPj2WZDXpsuAE6DASFX1pJaBVolC/E8gMSSeLFsgBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d3JncEp1IIoTlbZ4N+cKczvk9mX8qOW01eXp1a92G4+P6NlMRBEoG2fOcAcrFX6K6 pY2RWrRT91mwqhdgdyhQzy4yIxJUIH4ZZevPG3fjwsdgO0pflrNa2sLh82984/29dK lgLPgUTP5WCckDSdOONjXRhyGxkmWiaFeDX2GMT4= 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.9 20/29] xen/blkfront: fix leaking data in shared pages Date: Tue, 5 Jul 2022 13:58:01 +0200 Message-Id: <20220705115606.344468678@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115605.742248854@linuxfoundation.org> References: <20220705115605.742248854@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 @@ -297,7 +297,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; @@ -1729,7 +1729,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; @@ -2311,7 +2311,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_NOIO); + struct page *indirect_page = alloc_page(GFP_NOIO | + __GFP_ZERO); if (!indirect_page) goto out_of_memory; list_add(&indirect_page->lru, &rinfo->indirect_pages);