CVE-2022-49080

Source
https://cve.org/CVERecord?id=CVE-2022-49080
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49080.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49080
Downstream
Related
Published
2025-02-26T01:54:41.176Z
Modified
2026-03-12T03:24:33.732684Z
Summary
mm/mempolicy: fix mpol_new leak in shared_policy_replace
Details

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

mm/mempolicy: fix mpolnew leak in sharedpolicy_replace

If mpolnew is allocated but not used in restart loop, mpolnew will be freed via mpolput before returning to the caller. But refcnt is not initialized yet, so mpolput could not do the right things and might leak the unused mpol_new. This would happen if mempolicy was updated on the shared shmem file while the sp->lock has been dropped during the memory allocation.

This issue could be triggered easily with the below code snippet if there are many processes doing the below work at the same time:

shmid = shmget((keyt)5566, 1024 * PAGESIZE, 0666|IPCCREAT); shm = shmat(shmid, 0, 0); loop many times { mbind(shm, 1024 * PAGESIZE, MPOLLOCAL, mask, maxnode, 0); mbind(shm + 128 * PAGESIZE, 128 * PAGESIZE, MPOLDEFAULT, mask, maxnode, 0); }

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49080.json"
}
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
42288fe366c4f1ce7522bc9f27d0bc2a81c55264
Fixed
8510c2346d9e47a72b7f018a36ef0c39483e53d6
Fixed
5e16dc5378abd749a836daa9ee4ab2c8d2668999
Fixed
39a32f3c06f6d68a530bf9612afa19f50f12e93d
Fixed
25f506273b6ae806fd46bfcb6fdaa5b9ec81a05b
Fixed
f7e183b0a7136b6dc9c7b9b2a85a608a8feba894
Fixed
198932a14aeb19a15cf19e51e151d023bc4cd648
Fixed
6e00309ac716fa8225f0cbde2cd9c24f0e74ee21
Fixed
fe39ac59dbbf893b73b24e3184161d0bd06d6651
Fixed
4ad099559b00ac01c3726e5c95dc3108ef47d03e

Database specific

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