CVE-2024-36945: net/smc: fix neighbour and rtable leak in smc_ib_find_route()
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net/smc: fix neighbour and rtable leak in smc_ib_find_route()
In smc_ib_find_route(), the neighbour found by neigh_lookup() and rtable resolved by ip_route_output_flow() are not released or put before return. It may cause the refcount leak, so fix it.
The Linux kernel CVE team has assigned CVE-2024-36945 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.16 with commit e5c4744cfb59 and fixed in 6.1.91 with commit d5a466ab6e78 Issue introduced in 5.16 with commit e5c4744cfb59 and fixed in 6.6.31 with commit 5df93c029a90 Issue introduced in 5.16 with commit e5c4744cfb59 and fixed in 6.8.10 with commit da91e447d06d Issue introduced in 5.16 with commit e5c4744cfb59 and fixed in 6.9 with commit 2ddc0dd7fec8
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-36945
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:
net/smc/smc_ib.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/d5a466ab6e78d6f2e0f64435f1e17246c8e941ff https://git.kernel.org/stable/c/5df93c029a907b0ff5a4eeadd77ba06ff0a277d2 https://git.kernel.org/stable/c/da91e447d06dc649fcf46e59122e7bf8f0b2e0db https://git.kernel.org/stable/c/2ddc0dd7fec86ee53b8928a5cca5fbddd4fc7c06