{"id":"CVE-2022-49080","aliases":["CVE-2022-49080"],"related":[],"kind":"vulnerability","state":"published","title":"mm/mempolicy: fix mpol_new leak in shared_policy_replace","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: fix mpol_new leak in shared_policy_replace\n\nIf mpol_new is allocated but not used in restart loop, mpol_new will be\nfreed via mpol_put before returning to the caller.  But refcnt is not\ninitialized yet, so mpol_put could not do the right things and might\nleak the unused mpol_new.  This would happen if mempolicy was updated on\nthe shared shmem file while the sp->lock has been dropped during the\nmemory allocation.\n\nThis issue could be triggered easily with the below code snippet if\nthere are many processes doing the below work at the same time:\n\n  shmid = shmget((key_t)5566, 1024 * PAGE_SIZE, 0666|IPC_CREAT);\n  shm = shmat(shmid, 0, 0);\n  loop many times {\n    mbind(shm, 1024 * PAGE_SIZE, MPOL_LOCAL, mask, maxnode, 0);\n    mbind(shm + 128 * PAGE_SIZE, 128 * PAGE_SIZE, MPOL_DEFAULT, mask,\n          maxnode, 0);\n  }","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: fix mpol_new leak in shared_policy_replace\n\nIf mpol_new is allocated but not used in restart loop, mpol_new will be\nfreed via mpol_put before returning to the caller.  But refcnt is not\ninitialized yet, so mpol_put could not do the right things and might\nleak the unused mpol_new.  This would happen if mempolicy was updated on\nthe shared shmem file while the sp->lock has been dropped during the\nmemory allocation.\n\nThis issue could be triggered easily with the below code snippet if\nthere are many processes doing the below work at the same time:\n\n  shmid = shmget((key_t)5566, 1024 * PAGE_SIZE, 0666|IPC_CREAT);\n  shm = shmat(shmid, 0, 0);\n  loop many times {\n    mbind(shm, 1024 * PAGE_SIZE, MPOL_LOCAL, mask, maxnode, 0);\n    mbind(shm + 128 * PAGE_SIZE, 128 * PAGE_SIZE, MPOL_DEFAULT, mask,\n          maxnode, 0);\n  }","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm/mempolicy: arregla la fuga de mpol_new en shared_policy_replace Si mpol_new se asigna pero no se usa en el bucle de reinicio, mpol_new se liberará a través de mpol_put antes de regresar al llamador. Pero refcnt aún no se ha inicializado, por lo que mpol_put no podría hacer las cosas correctas y podría filtrar el mpol_new no utilizado. Esto sucedería si mempolicy se actualizara en el archivo shmem compartido mientras se eliminaba sp-&gt;lock durante la asignación de memoria. Este problema se podría activar fácilmente con el siguiente fragmento de código si hay muchos procesos haciendo el siguiente trabajo al mismo tiempo: shmid = shmget((key_t)5566, 1024 * PAGE_SIZE, 0666|IPC_CREAT); shm = shmat(shmid, 0, 0); repetir muchas veces { mbind(shm, 1024 * PAGE_SIZE, MPOL_LOCAL, mask, maxnode, 0); mbind(shm + 128 * PAGE_SIZE, 128 * PAGE_SIZE, MPOL_DEFAULT, mask, maxnode, 0); }","source":"nvd"}],"published":"2025-02-26T01:54:41.176Z","modified":"2026-06-17T05:17:01.510Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"8510c2346d9e47a72b7f018a36ef0c39483e53d6","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"5e16dc5378abd749a836daa9ee4ab2c8d2668999","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"39a32f3c06f6d68a530bf9612afa19f50f12e93d","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"25f506273b6ae806fd46bfcb6fdaa5b9ec81a05b","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"f7e183b0a7136b6dc9c7b9b2a85a608a8feba894","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"198932a14aeb19a15cf19e51e151d023bc4cd648","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"6e00309ac716fa8225f0cbde2cd9c24f0e74ee21","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"fe39ac59dbbf893b73b24e3184161d0bd06d6651","status":"affected"},{"type":"git","introduced":"42288fe366c4f1ce7522bc9f27d0bc2a81c55264","fixed":"4ad099559b00ac01c3726e5c95dc3108ef47d03e","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.8","status":"unaffected"},{"type":"semver","introduced":"4.9.311","lastAffected":"4.9.*","status":"unaffected"},{"type":"semver","introduced":"4.14.276","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.238","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.189","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.111","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.34","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.16.20","lastAffected":"5.16.*","status":"unaffected"},{"type":"semver","introduced":"5.17.3","lastAffected":"5.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"3.8.1","fixed":"4.9.311"},{"status":"affected","introduced":"4.10","fixed":"4.14.276"},{"status":"affected","introduced":"4.15","fixed":"4.19.238"},{"status":"affected","introduced":"4.20","fixed":"5.4.189"},{"status":"affected","introduced":"5.5","fixed":"5.10.111"},{"status":"affected","introduced":"5.11","fixed":"5.15.34"},{"status":"affected","introduced":"5.16","fixed":"5.16.20"},{"status":"affected","introduced":"5.17","fixed":"5.17.3"},{"status":"affected","version":"3.8"},{"status":"affected","version":"3.8"},{"status":"affected","version":"3.8"},{"status":"affected","version":"3.8"},{"status":"affected","version":"3.8"},{"status":"affected","version":"3.8"},{"status":"affected","version":"3.8"},{"status":"affected","version":"5.18"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/8510c2346d9e47a72b7f018a36ef0c39483e53d6","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5e16dc5378abd749a836daa9ee4ab2c8d2668999","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/39a32f3c06f6d68a530bf9612afa19f50f12e93d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/25f506273b6ae806fd46bfcb6fdaa5b9ec81a05b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f7e183b0a7136b6dc9c7b9b2a85a608a8feba894","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/198932a14aeb19a15cf19e51e151d023bc4cd648","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6e00309ac716fa8225f0cbde2cd9c24f0e74ee21","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fe39ac59dbbf893b73b24e3184161d0bd06d6651","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4ad099559b00ac01c3726e5c95dc3108ef47d03e","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49080","url":"https://www.cve.org/CVERecord?id=CVE-2022-49080","licence":"CVE Terms of Use","modified":"2026-05-11T18:52:38.593Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49080","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49080","licence":"Public domain","modified":"2026-06-17T05:17:01.510Z"}],"updatedAt":"2026-11-25T22:58:20.155Z","epss":{"score":0.00312,"percentile":0.25977,"date":"2026-12-02T12:00:21.000Z"}}