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 50C01305E20 for ; Mon, 15 Sep 2025 14:11:51 +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=1757945511; cv=none; b=NcUhX//fCx09+4E52FLgPEaf7llmfnxn+ggdy/ttrEAE+EYhYQCeQQQuOe4OTDDGapMpkVPNKndNElt0X7hdxH1hv9N9jwtgdmHu3UvdWP6Ov8f+ezYstNqdnqcA50m0VnSfYatVOGJHSELMDc3Tyw9+YwOwoXC/8OeiBm5Jdx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757945511; c=relaxed/simple; bh=H9wqq92+yTzjY3IxbAVyNzO1LfIVlfA2x2W9QUBIbDE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AI1XVhr8dLx+AW1idKAl0EEi/R0Sd3xdm/VndYkdX7iGTKi/U6sugY1FfVIdC9kdtUvniTujJKylIW5QUZ4EllWNsnAanjbela2qplll3GEJ8ocRyQqEXkw11WK0ZGwqB7xwVbKuXetWfhvSSl+/mkC0s3wDdp5TjO6Q+OjQEXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hnrt4Dm+; 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="hnrt4Dm+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8E2CC4CEF1; Mon, 15 Sep 2025 14:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757945511; bh=H9wqq92+yTzjY3IxbAVyNzO1LfIVlfA2x2W9QUBIbDE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hnrt4Dm+OtZkQqPHvyZ69N8ks6XgPOOfCAg6RZZTF0HnErWyC/OiHjZHtRa2av1FX wWOJTgHjqpkuiJG4mCOgQQBrTz4V3D7j5kyNfcC9+Rn+x1HOZ9+lXvdCCq0qDE5zaD g7IpeSv6iy/S3qRXwVJ/+I9kYn3sjHKRW7zqlt6w= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53181: dma-buf/dma-resv: Stop leaking on krealloc() failure Date: Mon, 15 Sep 2025 16:02:35 +0200 Message-ID: <2025091556-CVE-2023-53181-608c@gregkh> X-Mailer: git-send-email 2.51.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=2462; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=cMEljk/qBUshEN1eleeJMQAPO3Aw3WE/8WnEhnZqmVo=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknZEJMC39wqbR+knV4MuWe+oEbG/IfvLvvf92snH3uz n2n1ict7YhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJdOxkmKc+8y93Z5/tqlnR ffYdXze0vejy12WYK8S6hjXoGffD/4yZGpenbN9zPeKXMwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: dma-buf/dma-resv: Stop leaking on krealloc() failure Currently dma_resv_get_fences() will leak the previously allocated array if the fence iteration got restarted and the krealloc_array() fails. Free the old array by hand, and make sure we still clear the returned *fences so the caller won't end up accessing freed memory. Some (but not all) of the callers of dma_resv_get_fences() seem to still trawl through the array even when dma_resv_get_fences() failed. And let's zero out *num_fences as well for good measure. The Linux kernel CVE team has assigned CVE-2023-53181 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit d3c80698c9f58a0683badf78793eebaa0c71afbd and fixed in 6.1.42 with commit 19e7b9f1f7e1cb92a4cc53b4c064f7fb4b1f1983 Issue introduced in 5.16 with commit d3c80698c9f58a0683badf78793eebaa0c71afbd and fixed in 6.4.7 with commit 819656cc03dec7f7f7800274dfbc8eb49f888e9f Issue introduced in 5.16 with commit d3c80698c9f58a0683badf78793eebaa0c71afbd and fixed in 6.5 with commit 05abb3be91d8788328231ee02973ab3d47f5e3d2 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-2023-53181 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/dma-buf/dma-resv.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/19e7b9f1f7e1cb92a4cc53b4c064f7fb4b1f1983 https://git.kernel.org/stable/c/819656cc03dec7f7f7800274dfbc8eb49f888e9f https://git.kernel.org/stable/c/05abb3be91d8788328231ee02973ab3d47f5e3d2