Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39C1212D768 for ; Wed, 1 May 2024 13:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714568843; cv=none; b=MGLTDGZKKdR9HRSZb4KfVAMqyYZnn+bWRLUt/rkrjWSgtR4fybCo0XrqD/0AdIFujPUcorMWmxPlmNlgvo7HlEw28M206njtBeRgue6Xy3sMC/UteNljy3JldOYA0A84aLLsifrc1ZhXU5ZVLe2/vuUBxDmWhxMSRGgvgVgcUTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714568843; c=relaxed/simple; bh=Ihcx+XUSktgD7imePxZciy0tQIgLeVLKFULV8vzm0c8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T7SJKVCsKVHkzX3VjUPgB/oihcTHmeD4g+/1Vtqh0oiYPsdJwAQx+Windg3PK7a/AC93jcDDJgUgB5hK8wqQVJYAujbYkeWRBdsK4Dos+NVRpda4BHUnKjD9QGOndH99W3kS4j6GRiczNpXlEEx0BMI7Bx8wpNdjPmvjKa90Xps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BUI57js2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BUI57js2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B43A4C113CC; Wed, 1 May 2024 13:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714568843; bh=Ihcx+XUSktgD7imePxZciy0tQIgLeVLKFULV8vzm0c8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BUI57js2QTX1iiXThXhGGZYF4gv3wy8Kfq/ALxIvSffPA4y4IF6GButusgmSfhUrD 8reWB20QSjwNLwIahtKnFx/iFwKEjHd9PWOUGpP0xVzW6g640+JD1Km76+l/3G7FOQ WtXdqzgH/7VRfHbS9UPUFn8Wlp2uTKU0Fh/+oJEg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-27066: virtio: packed: fix unmap leak for indirect desc table Date: Wed, 1 May 2024 15:06:37 +0200 Message-ID: <2024050132-CVE-2024-27066-686a@gregkh> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2767; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Ihcx+XUSktgD7imePxZciy0tQIgLeVLKFULV8vzm0c8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlGdhENFixvrszvmO/U0VwZtf8us4Dl6tbYPTKz6mT2L rvZW53XEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPpL2WYn5rBonky5FjFZoMJ ikJOi1xq3eeXMCw4UDMtT7FvX2yLlnAWkxjnpzU9PfMB X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: virtio: packed: fix unmap leak for indirect desc table When use_dma_api and premapped are true, then the do_unmap is false. Because the do_unmap is false, vring_unmap_extra_packed is not called by detach_buf_packed. if (unlikely(vq->do_unmap)) { curr = id; for (i = 0; i < state->num; i++) { vring_unmap_extra_packed(vq, &vq->packed.desc_extra[curr]); curr = vq->packed.desc_extra[curr].next; } } So the indirect desc table is not unmapped. This causes the unmap leak. So here, we check vq->use_dma_api instead. Synchronously, dma info is updated based on use_dma_api judgment This bug does not occur, because no driver use the premapped with indirect. The Linux kernel CVE team has assigned CVE-2024-27066 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit b319940f83c2 and fixed in 6.6.23 with commit e142169aca55 Issue introduced in 6.6 with commit b319940f83c2 and fixed in 6.7.11 with commit 75450ff8c6fe Issue introduced in 6.6 with commit b319940f83c2 and fixed in 6.8.2 with commit 51bacd9d29bf Issue introduced in 6.6 with commit b319940f83c2 and fixed in 6.9-rc1 with commit d5c0ed17fea6 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-27066 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/virtio/virtio_ring.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/e142169aca5546ae6619c39a575cda8105362100 https://git.kernel.org/stable/c/75450ff8c6fe8755bf5b139b238eaf9739cfd64e https://git.kernel.org/stable/c/51bacd9d29bf98c3ebc65e4a0477bb86306b4140 https://git.kernel.org/stable/c/d5c0ed17fea60cca9bc3bf1278b49ba79242bbcd