| 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-2024-44964: idpf: fix memory leaks and crashes while performing a soft reset |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| idpf: fix memory leaks and crashes while performing a soft reset |
| |
| The second tagged commit introduced a UAF, as it removed restoring |
| q_vector->vport pointers after reinitializating the structures. |
| This is due to that all queue allocation functions are performed here |
| with the new temporary vport structure and those functions rewrite |
| the backpointers to the vport. Then, this new struct is freed and |
| the pointers start leading to nowhere. |
| |
| But generally speaking, the current logic is very fragile. It claims |
| to be more reliable when the system is low on memory, but in fact, it |
| consumes two times more memory as at the moment of running this |
| function, there are two vports allocated with their queues and vectors. |
| Moreover, it claims to prevent the driver from running into "bad state", |
| but in fact, any error during the rebuild leaves the old vport in the |
| partially allocated state. |
| Finally, if the interface is down when the function is called, it always |
| allocates a new queue set, but when the user decides to enable the |
| interface later on, vport_open() allocates them once again, IOW there's |
| a clear memory leak here. |
| |
| Just don't allocate a new queue set when performing a reset, that solves |
| crashes and memory leaks. Readd the old queue number and reopen the |
| interface on rollback - that solves limbo states when the device is left |
| disabled and/or without HW queues enabled. |
| |
| The Linux kernel CVE team has assigned CVE-2024-44964 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 6.7 with commit 02cbfba1add5bd9088c7d14c6b93b77a6ea8f3bb and fixed in 6.10.5 with commit 6b289f8d91537ec1e4f9c7b38b31b90d93b1419b |
| Issue introduced in 6.7 with commit 02cbfba1add5bd9088c7d14c6b93b77a6ea8f3bb and fixed in 6.11 with commit f01032a2ca099ec8d619aaa916c3762aa62495df |
| |
| 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-44964 |
| 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/net/ethernet/intel/idpf/idpf_lib.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/6b289f8d91537ec1e4f9c7b38b31b90d93b1419b |
| https://git.kernel.org/stable/c/f01032a2ca099ec8d619aaa916c3762aa62495df |