| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2021-47305: dma-buf/sync_file: Don't leak fences on merge failure |
| |
| 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 a02b9dc90d844cc7df7b63264e7920cc425052d9 and fixed in 4.14.241 with commit 19f51c2529339280d2c8c6427cd3e21ddf1ac3f8 |
| Issue introduced in 4.9 with commit a02b9dc90d844cc7df7b63264e7920cc425052d9 and fixed in 4.19.199 with commit e0355a0ad31a1d677b2a4514206de4902bd550e8 |
| Issue introduced in 4.9 with commit a02b9dc90d844cc7df7b63264e7920cc425052d9 and fixed in 5.4.135 with commit 41f45e91c92c8480242ea448d54e28c753b13902 |
| Issue introduced in 4.9 with commit a02b9dc90d844cc7df7b63264e7920cc425052d9 and fixed in 5.10.53 with commit 0d514185ae792d3a1903c8e1a83899aa996705ce |
| Issue introduced in 4.9 with commit a02b9dc90d844cc7df7b63264e7920cc425052d9 and fixed in 5.13.5 with commit 19edcd97727aae9362444a859a24d99a8730cb27 |
| Issue introduced in 4.9 with commit a02b9dc90d844cc7df7b63264e7920cc425052d9 and fixed in 5.14 with commit ffe000217c5068c5da07ccb1c0f8cce7ad767435 |
| |
| 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 |