From patchwork Fri Oct 14 23:48:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1690233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=P9amZqXl; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mq35B530vz23jk for ; Sat, 15 Oct 2022 10:49:18 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ojUQS-0000D4-IW; Fri, 14 Oct 2022 23:49:12 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ojUQQ-0000Av-Hz for kernel-team@lists.ubuntu.com; Fri, 14 Oct 2022 23:49:10 +0000 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 485903F495 for ; Fri, 14 Oct 2022 23:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1665791350; bh=BrXS4cBMYiTkRfGsjf3OxsC6rgwcIMnO2MlMYDGD24Y=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=P9amZqXlM4+sl2qbVJc2656apFCVfbzb+CTBWV/5wtbyPSQ10BiTru+F1v/rQFysz k7f1VVu+KwdiVspSmwNh/mfDWWCx3ihF3GhlcwvWh46vqrFjqs4cAP/wQpXNcOIUxz pQCi7iD5gh9XNV4rcH+lYKutaK5fQ9d0vY9/MPXRWSI2fLA3JWxDb92jO42D3JsCLR muMRrQs5GoRX2+4ko70JFn0uVxZa1vWc35IbJipak4LMrxlH7ZsB1mRn/7Bc4R5nGR 8w10vIdUnunuL12eM1zNox/wIFhlSQx4VTm8tAN4zhOLoyCZTfAklvc/4KXQHypeSB CAYJpOwTkLu4Q== Received: by mail-wr1-f70.google.com with SMTP id l16-20020adfc790000000b00230c2505f96so2507947wrg.4 for ; Fri, 14 Oct 2022 16:49:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BrXS4cBMYiTkRfGsjf3OxsC6rgwcIMnO2MlMYDGD24Y=; b=rQ9bNknPtxd/ddPsMhCJj2EM1pMmFUgEOHSvEe+UeIYbbmSmJoIGe1M/ynUrg25FnP 30k2uri7y778p3OTX3dcE2Zkhm09ZPCf8ptd04IVMEx+DRUsgsOtqsW2FsdeGZDuFydu yArjpdW/iYP8MMrHHfAhlKnvqaaXa2P2VXmSx7o48EYvOskv6tpExDIAzHlgfEPUbyh6 ghQfBpasrtCIrjIsXnfK1rFXLXhGg77641HA8cpGwCpG608qiHNonZ11aeRGgc6HweLU vM5g9hQibgLIi1k/3IfBV/N92g/BkcZWaFwPU58GLuSEFVat7qkO2APRTMeHvqW107Cg lFOg== X-Gm-Message-State: ACrzQf2/Itss3DtlPsp56cuFTuo9E1n9cJUK7V/TRvP/z9hQNG8RK9Sw T6bgQXh3ZLwoftKZUbhZmOck+AaTpxZLjK4WHhOCPHC4UfQXuNOORMGOkaea0M+dFEmxG3PZjLB rygYSnUBpHAxnMrZlQhP+6aK6tcti96e1ruKpgD/ceA== X-Received: by 2002:a05:600c:54f2:b0:3c6:bd60:5390 with SMTP id jb18-20020a05600c54f200b003c6bd605390mr11868061wmb.206.1665791347951; Fri, 14 Oct 2022 16:49:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7V02YnAISFKRClW7qbI6rUnMuBJFZpCjpqcfbmKrRTu+/DuseX/rwTmX5/MvCaV8+gH2R19A== X-Received: by 2002:a05:600c:54f2:b0:3c6:bd60:5390 with SMTP id jb18-20020a05600c54f200b003c6bd605390mr11868056wmb.206.1665791347773; Fri, 14 Oct 2022 16:49:07 -0700 (PDT) Received: from localhost ([2001:67c:1560:8007::aac:c03c]) by smtp.gmail.com with ESMTPSA id t8-20020a5d5348000000b0022ac119fcc5sm2872437wrv.60.2022.10.14.16.49.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 16:49:07 -0700 (PDT) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU HWE-5.17 1/1] xen/blkfront: fix leaking data in shared pages Date: Sat, 15 Oct 2022 02:48:44 +0300 Message-Id: <20221014234841.96935-3-cengiz.can@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221014234841.96935-1-cengiz.can@canonical.com> References: <20221014234841.96935-1-cengiz.can@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Roger Pau Monne 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 CVE-2022-26365 (cherry picked from commit 2f446ffe9d737e9a844b97887919c4fda18246e7) Signed-off-by: Cengiz Can --- drivers/block/xen-blkfront.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 03b5fb341e589..380fbc425bcc5 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -313,7 +313,7 @@ static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) 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; @@ -2204,7 +2204,8 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) 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);