{"id":"CVE-2026-46042","aliases":["CVE-2026-46042"],"related":[],"kind":"vulnerability","state":"published","title":"mm/mempolicy: fix memory leaks in weighted_interleave_auto_store()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: fix memory leaks in weighted_interleave_auto_store()\n\nweighted_interleave_auto_store() fetches old_wi_state inside the if\n(!input) block only.  This causes two memory leaks:\n\n1. When a user writes \"false\" and the current mode is already manual,\n   the function returns early without freeing the freshly allocated\n   new_wi_state.\n\n2. When a user writes \"true\", old_wi_state stays NULL because the\n   fetch is skipped entirely. The old state is then overwritten by\n   rcu_assign_pointer() but never freed, since the cleanup path is\n   gated on old_wi_state being non-NULL. A user can trigger this\n   repeatedly by writing \"1\" in a loop.\n\nFix both leaks by moving the old_wi_state fetch before the input check,\nmaking it unconditional.  This also allows a unified early return for both\n\"true\" and \"false\" when the requested mode matches the current mode.\n\nReviewed by: Donet Tom <donettom@linux.ibm.com>","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: fix memory leaks in weighted_interleave_auto_store()\n\nweighted_interleave_auto_store() fetches old_wi_state inside the if\n(!input) block only.  This causes two memory leaks:\n\n1. When a user writes \"false\" and the current mode is already manual,\n   the function returns early without freeing the freshly allocated\n   new_wi_state.\n\n2. When a user writes \"true\", old_wi_state stays NULL because the\n   fetch is skipped entirely. The old state is then overwritten by\n   rcu_assign_pointer() but never freed, since the cleanup path is\n   gated on old_wi_state being non-NULL. A user can trigger this\n   repeatedly by writing \"1\" in a loop.\n\nFix both leaks by moving the old_wi_state fetch before the input check,\nmaking it unconditional.  This also allows a unified early return for both\n\"true\" and \"false\" when the requested mode matches the current mode.\n\nReviewed by: Donet Tom <donettom@linux.ibm.com>","source":"cvelist"}],"published":"2026-05-27T12:56:56.830Z","modified":"2026-06-17T10:52:57.130Z","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":"e341f9c3c8412e57fe0042a33a2640245ecdf619","fixed":"c42a7efb9060d89b72708ffaf255d0002c2164a7","status":"affected"},{"type":"git","introduced":"e341f9c3c8412e57fe0042a33a2640245ecdf619","fixed":"39caa9ca863f96b3d00447c5aa200cabda489856","status":"affected"},{"type":"git","introduced":"e341f9c3c8412e57fe0042a33a2640245ecdf619","fixed":"6fae274ce0e3109cbbc4c18b354eaace1f0af7d7","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.16","status":"unaffected"},{"type":"semver","introduced":"6.18.27","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.4","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.1","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":"6.16","fixed":"6.18.27"},{"status":"affected","introduced":"6.19","fixed":"7.0.4"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/c42a7efb9060d89b72708ffaf255d0002c2164a7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/39caa9ca863f96b3d00447c5aa200cabda489856","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6fae274ce0e3109cbbc4c18b354eaace1f0af7d7","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46042","url":"https://www.cve.org/CVERecord?id=CVE-2026-46042","licence":"CVE Terms of Use","modified":"2026-06-14T17:50:08.044Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46042","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46042","licence":"Public domain","modified":"2026-06-17T10:52:57.130Z"}],"updatedAt":"2026-11-25T22:59:22.557Z","epss":{"score":0.00126,"percentile":0.02484,"date":"2026-12-01T12:00:22.000Z"}}