CVE-2022-49866: net: wwan: mhi: fix memory leak in mhi_mbim_dellink
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: wwan: mhi: fix memory leak in mhi_mbim_dellink
MHI driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network device, which causes a memory leak.
This patch sets needs_free_netdev to true when registers network device, which makes netdev subsystem call free_netdev() automatically after unregister_netdevice().
The Linux kernel CVE team has assigned CVE-2022-49866 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.15 with commit aa730a9905b7b079ef2fffdab7f15dbb842f5c7c and fixed in 5.15.79 with commit 2845bc9070cef0c651987487d84d4813d64675dd Issue introduced in 5.15 with commit aa730a9905b7b079ef2fffdab7f15dbb842f5c7c and fixed in 6.0.9 with commit 3cd3ffe952f78ec5dadf300cb58d4b38a0c0106d Issue introduced in 5.15 with commit aa730a9905b7b079ef2fffdab7f15dbb842f5c7c and fixed in 6.1 with commit 668205b9c9f94d5ed6ab00cce9a46a654c2b5d16
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-49866
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/wwan/mhi_wwan_mbim.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/2845bc9070cef0c651987487d84d4813d64675dd https://git.kernel.org/stable/c/3cd3ffe952f78ec5dadf300cb58d4b38a0c0106d https://git.kernel.org/stable/c/668205b9c9f94d5ed6ab00cce9a46a654c2b5d16