{"id":"CVE-2024-26951","aliases":["CVE-2024-26951"],"related":[],"kind":"vulnerability","state":"published","title":"wireguard: netlink: check for dangling peer via is_dead instead of empty list","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nwireguard: netlink: check for dangling peer via is_dead instead of empty list\n\nIf all peers are removed via wg_peer_remove_all(), rather than setting\npeer_list to empty, the peer is added to a temporary list with a head on\nthe stack of wg_peer_remove_all(). If a netlink dump is resumed and the\ncursored peer is one that has been removed via wg_peer_remove_all(), it\nwill iterate from that peer and then attempt to dump freed peers.\n\nFix this by instead checking peer->is_dead, which was explictly created\nfor this purpose. Also move up the device_update_lock lockdep assertion,\nsince reading is_dead relies on that.\n\nIt can be reproduced by a small script like:\n\n    echo \"Setting config...\"\n    ip link add dev wg0 type wireguard\n    wg setconf wg0 /big-config\n    (\n            while true; do\n                    echo \"Showing config...\"\n                    wg showconf wg0 > /dev/null\n            done\n    ) &\n    sleep 4\n    wg setconf wg0 <(printf \"[Peer]\\nPublicKey=$(wg genkey)\\n\")\n\nResulting in:\n\n    BUG: KASAN: slab-use-after-free in __lock_acquire+0x182a/0x1b20\n    Read of size 8 at addr ffff88811956ec70 by task wg/59\n    CPU: 2 PID: 59 Comm: wg Not tainted 6.8.0-rc2-debug+ #5\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x47/0x70\n     print_address_description.constprop.0+0x2c/0x380\n     print_report+0xab/0x250\n     kasan_report+0xba/0xf0\n     __lock_acquire+0x182a/0x1b20\n     lock_acquire+0x191/0x4b0\n     down_read+0x80/0x440\n     get_peer+0x140/0xcb0\n     wg_get_device_dump+0x471/0x1130","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nwireguard: netlink: check for dangling peer via is_dead instead of empty list\n\nIf all peers are removed via wg_peer_remove_all(), rather than setting\npeer_list to empty, the peer is added to a temporary list with a head on\nthe stack of wg_peer_remove_all(). If a netlink dump is resumed and the\ncursored peer is one that has been removed via wg_peer_remove_all(), it\nwill iterate from that peer and then attempt to dump freed peers.\n\nFix this by instead checking peer->is_dead, which was explictly created\nfor this purpose. Also move up the device_update_lock lockdep assertion,\nsince reading is_dead relies on that.\n\nIt can be reproduced by a small script like:\n\n    echo \"Setting config...\"\n    ip link add dev wg0 type wireguard\n    wg setconf wg0 /big-config\n    (\n            while true; do\n                    echo \"Showing config...\"\n                    wg showconf wg0 > /dev/null\n            done\n    ) &\n    sleep 4\n    wg setconf wg0 <(printf \"[Peer]\\nPublicKey=$(wg genkey)\\n\")\n\nResulting in:\n\n    BUG: KASAN: slab-use-after-free in __lock_acquire+0x182a/0x1b20\n    Read of size 8 at addr ffff88811956ec70 by task wg/59\n    CPU: 2 PID: 59 Comm: wg Not tainted 6.8.0-rc2-debug+ #5\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x47/0x70\n     print_address_description.constprop.0+0x2c/0x380\n     print_report+0xab/0x250\n     kasan_report+0xba/0xf0\n     __lock_acquire+0x182a/0x1b20\n     lock_acquire+0x191/0x4b0\n     down_read+0x80/0x440\n     get_peer+0x140/0xcb0\n     wg_get_device_dump+0x471/0x1130","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: wireguard: netlink: verifique si hay pares pendientes a través de is_dead en lugar de una lista vacía. Si todos los pares se eliminan a través de wg_peer_remove_all(), en lugar de configurar peer_list como vacío, el par se agrega a una lista temporal. lista con un encabezado en la pila de wg_peer_remove_all(). Si se reanuda un volcado de netlink y el par seleccionado es uno que se eliminó mediante wg_peer_remove_all(), iterará desde ese par y luego intentará volcar los pares liberados. Para solucionar este problema, marque peer-&gt;is_dead, que se creó explícitamente para este propósito. También suba la aserción de bloqueo de dispositivo_update_lock, ya que la lectura is_dead depende de eso. Se puede reproducir mediante un pequeño script como: echo \"Configuración de configuración...\" ip link add dev wg0 tipo wireguard wg setconf wg0 /big-config (mientras sea verdadero; haga echo \"Mostrando configuración...\" wg showconf wg0 &gt; / dev/null done) &amp; sleep 4 wg setconf wg0 &lt;(printf \"[Peer]\\nPublicKey=$(wg genkey)\\n\") Resultando en: ERROR: KASAN: slab-use-after-free en __lock_acquire+0x182a/0x1b20 Lectura de tamaño 8 en la dirección ffff88811956ec70 mediante la tarea wg/59 CPU: 2 PID: 59 Comm: wg Not tainted 6.8.0-rc2-debug+ #5 Seguimiento de llamadas:  dump_stack_lvl+0x47/0x70 print_address_description.constprop.0+0x2c /0x380 print_report+0xab/0x250 kasan_report+0xba/0xf0 __lock_acquire+0x182a/0x1b20 lock_acquire+0x191/0x4b0 down_read+0x80/0x440 get_peer+0x140/0xcb0 wg_get_device_dump+0x471/0x1130","source":"nvd"}],"published":"2024-05-01T05:18:34.520Z","modified":"2026-10-15T01:17:33.440Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"f52be46e3e6ecefc2539119784324f0cbc09620a","status":"affected"},{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"710a177f347282eea162aec8712beb1f42d5ad87","status":"affected"},{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"b7cea3a9af0853fdbb1b16633a458f991dde6aac","status":"affected"},{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"13d107794304306164481d31ce33f8fdb25a9c04","status":"affected"},{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"7bedfe4cfa38771840a355970e4437cd52d4046b","status":"affected"},{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"302b2dfc013baca3dea7ceda383930d9297d231d","status":"affected"},{"type":"git","introduced":"e7096c131e5161fa3b8e52a650d7719d2857adfd","fixed":"55b6c738673871c9b0edae05d0c97995c1ff08c4","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.6","status":"unaffected"},{"type":"semver","introduced":"5.10.215","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.154","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.84","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.24","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.7.12","lastAffected":"6.7.*","status":"unaffected"},{"type":"semver","introduced":"6.8.3","lastAffected":"6.8.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.9","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":"5.6","fixed":"5.10.215"},{"status":"affected","introduced":"5.11","fixed":"5.15.154"},{"status":"affected","introduced":"5.16","fixed":"6.1.84"},{"status":"affected","introduced":"6.2","fixed":"6.6.24"},{"status":"affected","introduced":"6.7","fixed":"6.7.12"},{"status":"affected","introduced":"6.8","fixed":"6.8.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f52be46e3e6ecefc2539119784324f0cbc09620a","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/710a177f347282eea162aec8712beb1f42d5ad87","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b7cea3a9af0853fdbb1b16633a458f991dde6aac","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/13d107794304306164481d31ce33f8fdb25a9c04","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7bedfe4cfa38771840a355970e4437cd52d4046b","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/302b2dfc013baca3dea7ceda383930d9297d231d","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/55b6c738673871c9b0edae05d0c97995c1ff08c4","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html","tags":["third-party-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-10T15:45:36.397Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-26951","url":"https://www.cve.org/CVERecord?id=CVE-2024-26951","licence":"CVE Terms of Use","modified":"2026-10-15T00:39:32.705Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-26951","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26951","licence":"Public domain","modified":"2026-10-15T01:17:33.440Z"}],"updatedAt":"2026-11-25T22:58:39.732Z","epss":{"score":0.00234,"percentile":0.15388,"date":"2026-12-01T12:00:22.000Z"}}