CVE-2022-49819: octeon_ep: fix potential memory leak in octep_device_setup()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
octeon_ep: fix potential memory leak in octep_device_setup()
When occur unsupported_dev and mbox init errors, it did not free oct->conf and iounmap() oct->mmio[i].hw_addr. That would trigger memory leak problem. Add kfree() for oct->conf and iounmap() for oct->mmio[i].hw_addr under unsupported_dev and mbox init errors to fix the problem.
The Linux kernel CVE team has assigned CVE-2022-49819 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit 862cd659a6fbac664f1fcdd7149046040a7a7e9c and fixed in 6.0.10 with commit 67b65a0db8a7fdad43159819f41335497a4bb04f Issue introduced in 5.19 with commit 862cd659a6fbac664f1fcdd7149046040a7a7e9c and fixed in 6.1 with commit e4041be97b15302ebfffda8bbd45f3b2d096048f
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-2022-49819
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/marvell/octeon_ep/octep_main.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/67b65a0db8a7fdad43159819f41335497a4bb04f https://git.kernel.org/stable/c/e4041be97b15302ebfffda8bbd45f3b2d096048f