CVE-2022-49290

Source
https://cve.org/CVERecord?id=CVE-2022-49290
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49290.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49290
Downstream
Related
Published
2025-02-26T01:56:27.500Z
Modified
2026-03-12T03:24:57.597255Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
mac80211: fix potential double free on mesh join
Details

In the Linux kernel, the following vulnerability has been resolved:

mac80211: fix potential double free on mesh join

While commit 6a01afcf8468 ("mac80211: mesh: Free ie data when leaving mesh") fixed a memory leak on mesh leave / teardown it introduced a potential memory corruption caused by a double free when rejoining the mesh:

ieee80211leavemesh() -> kfree(sdata->u.mesh.ie); ... ieee80211joinmesh() -> copymeshsetup() -> oldie = ifmsh->ie; -> kfree(oldie);

This double free / kernel panics can be reproduced by using wpa_supplicant with an encrypted mesh (if set up without encryption via "iw" then ifmsh->ie is always NULL, which avoids this issue). And then calling:

$ iw dev mesh0 mesh leave $ iw dev mesh0 mesh join my-mesh

Note that typically these commands are not used / working when using wpasupplicant. And it seems that wpasupplicant or wpacli are going through a NETDEVDOWN/NETDEVUP cycle between a mesh leave and mesh join where the NETDEVUP resets the mesh.ie to NULL via a memcpy of defaultmeshsetup in cfg80211netdevnotifier_call, which then avoids the memory corruption, too.

The issue was first observed in an application which was not using wpa_supplicant but "Senf" instead, which implements its own calls to nl80211.

Fixing the issue by removing the kfree()'ing of the mesh IE in the mesh join function and leaving it solely up to the mesh leave to free the mesh IE.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49290.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
3212d6248faf0efce6b7a718e198feecce0eea05
Fixed
615716af8644813355e014314a0bc1e961250f5a
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
86e7d4cd2ed5f4b0188afce8199faffcf1ae7c7e
Fixed
c1d9c3628ef0a0ca197595d0f9e01cd3b5dda186
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
37bccfa89559a70c044b5ccde3c916a91388e14a
Fixed
273ebddc5fda2967492cb0b6cdd7d81cfb821b76
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
3f15e3e62c80e180282f0cbc5559264e11c328b7
Fixed
3bbd0000d012f92aec423b224784fbf0f7bf40f8
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6a01afcf8468d3ca2bd8bbb27503f60dcf643b20
Fixed
5d3ff9542a40ce034416bca03864709540a36016
Fixed
12e407a8ef17623823fd0c066fbd7f103953d28d
Fixed
582d8c60c0c053684f7138875e8150d5749ffc17
Fixed
46bb87d40683337757a2f902fcd4244b32bb4e86
Fixed
4a2d4496e15ea5bb5c8e83b94ca8ca7fb045e7d3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
12e9cb1e7c93413112260991d094cfda712fdc97
Last affected
4f3193e08602462a806e8f53212e79c60a6f7488

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49290.json"