From mboxrd@z Thu Jan 1 00:00:00 1970 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 D6DC614264C for ; Tue, 21 May 2024 14:39:43 +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=1716302383; cv=none; b=XyY+ybwz0HcJVEX3n7fBi1uW0i5NNoBLecLGQKjzRKKj9ypDvGWUBSPK7LUg1gv5qAHj7TInQV+RB1XwqFO6TTbEDUfW4m/uxfGtKp0YzR/tnTzG6g1Vey+LnYLKQnuvch4GWB8odqOJNGAZh9SnSDOMuTqkMDOHTy8cEF6VLJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716302383; c=relaxed/simple; bh=2MnMdwckjcB9Ig84W4o5OCHXjajd+4QleP0mKuoM4gQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IBCNuX42LFwmviKKWmC6QeXTN81+TV2nIrWsKQ7UJR0HcQT4lw/GFvKxNDN9IRHgqWRacNSVR/KdLh8KytOLjvsz2Ke9jDe4TjTsitMeNjAGaCMYPe+dxDLFM6d9YrvPWB2pbT1hQUqwlF6g6w8hbmGdMPquc9r38G6qx0N19fE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LIP8QaSC; 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="LIP8QaSC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61845C2BD11; Tue, 21 May 2024 14:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716302383; bh=2MnMdwckjcB9Ig84W4o5OCHXjajd+4QleP0mKuoM4gQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LIP8QaSCspTL15NOyd8XO9jkISGKeBRN/CVIqmVWIuekQ9s8rEJm9NoU7AM2GnTA6 uo/3z5IyIcJj8IqEQ4ZBmyKacgZ1bN5vPcnZE3YYHZa2kohbCMAcuNqRpkyeHG66FL spmWqMTCie/OktILAqwH1YsCGPxeBaD3+UPjhhKc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47305: dma-buf/sync_file: Don't leak fences on merge failure Date: Tue, 21 May 2024 16:35:39 +0200 Message-ID: <2024052127-CVE-2021-47305-e1c5@gregkh> X-Mailer: git-send-email 2.45.1 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=2716; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2MnMdwckjcB9Ig84W4o5OCHXjajd+4QleP0mKuoM4gQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+G/Unfi7v74hnTKjtUCiUl7QM/Mwcq6e+yXrB75/ix Uotn3g7YlkYBJkYZMUUWb5s4zm6v+KQopeh7WmYOaxMIEMYuDgFYCLn9zHM4bOo9LlxPm/L5h0B e/aZ5YQo8D7hY1gwVT4nOzoxSU1AZH3ABBVHr/vynk8B 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: dma-buf/sync_file: Don't leak fences on merge failure Each add_fence() call does a dma_fence_get() on the relevant fence. In the error path, we weren't calling dma_fence_put() so all those fences got leaked. Also, in the krealloc_array failure case, we weren't freeing the fences array. Instead, ensure that i and fences are always zero-initialized and dma_fence_put() all the fences and kfree(fences) on every error path. The Linux kernel CVE team has assigned CVE-2021-47305 to this issue. Affected and fixed versions =========================== Issue introduced in 4.9 with commit a02b9dc90d84 and fixed in 4.14.241 with commit 19f51c252933 Issue introduced in 4.9 with commit a02b9dc90d84 and fixed in 4.19.199 with commit e0355a0ad31a Issue introduced in 4.9 with commit a02b9dc90d84 and fixed in 5.4.135 with commit 41f45e91c92c Issue introduced in 4.9 with commit a02b9dc90d84 and fixed in 5.10.53 with commit 0d514185ae79 Issue introduced in 4.9 with commit a02b9dc90d84 and fixed in 5.13.5 with commit 19edcd97727a Issue introduced in 4.9 with commit a02b9dc90d84 and fixed in 5.14 with commit ffe000217c50 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-2021-47305 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/sync_file.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/19f51c2529339280d2c8c6427cd3e21ddf1ac3f8 https://git.kernel.org/stable/c/e0355a0ad31a1d677b2a4514206de4902bd550e8 https://git.kernel.org/stable/c/41f45e91c92c8480242ea448d54e28c753b13902 https://git.kernel.org/stable/c/0d514185ae792d3a1903c8e1a83899aa996705ce https://git.kernel.org/stable/c/19edcd97727aae9362444a859a24d99a8730cb27 https://git.kernel.org/stable/c/ffe000217c5068c5da07ccb1c0f8cce7ad767435