{"id":"CVE-2025-38377","aliases":["CVE-2025-38377"],"related":[],"kind":"vulnerability","state":"published","title":"rose: fix dangling neighbour pointers in rose_rt_device_down()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nrose: fix dangling neighbour pointers in rose_rt_device_down()\n\nThere are two bugs in rose_rt_device_down() that can cause\nuse-after-free:\n\n1. The loop bound `t->count` is modified within the loop, which can\n   cause the loop to terminate early and miss some entries.\n\n2. When removing an entry from the neighbour array, the subsequent entries\n   are moved up to fill the gap, but the loop index `i` is still\n   incremented, causing the next entry to be skipped.\n\nFor example, if a node has three neighbours (A, A, B) with count=3 and A\nis being removed, the second A is not checked.\n\n    i=0: (A, A, B) -> (A, B) with count=2\n          ^ checked\n    i=1: (A, B)    -> (A, B) with count=2\n             ^ checked (B, not A!)\n    i=2: (doesn't occur because i < count is false)\n\nThis leaves the second A in the array with count=2, but the rose_neigh\nstructure has been freed. Code that accesses these entries assumes that\nthe first `count` entries are valid pointers, causing a use-after-free\nwhen it accesses the dangling pointer.\n\nFix both issues by iterating over the array in reverse order with a fixed\nloop bound. This ensures that all entries are examined and that the removal\nof an entry doesn't affect subsequent iterations.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nrose: fix dangling neighbour pointers in rose_rt_device_down()\n\nThere are two bugs in rose_rt_device_down() that can cause\nuse-after-free:\n\n1. The loop bound `t->count` is modified within the loop, which can\n   cause the loop to terminate early and miss some entries.\n\n2. When removing an entry from the neighbour array, the subsequent entries\n   are moved up to fill the gap, but the loop index `i` is still\n   incremented, causing the next entry to be skipped.\n\nFor example, if a node has three neighbours (A, A, B) with count=3 and A\nis being removed, the second A is not checked.\n\n    i=0: (A, A, B) -> (A, B) with count=2\n          ^ checked\n    i=1: (A, B)    -> (A, B) with count=2\n             ^ checked (B, not A!)\n    i=2: (doesn't occur because i < count is false)\n\nThis leaves the second A in the array with count=2, but the rose_neigh\nstructure has been freed. Code that accesses these entries assumes that\nthe first `count` entries are valid pointers, causing a use-after-free\nwhen it accesses the dangling pointer.\n\nFix both issues by iterating over the array in reverse order with a fixed\nloop bound. This ensures that all entries are examined and that the removal\nof an entry doesn't affect subsequent iterations.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: rose: corrección de punteros vecinos colgantes en rose_rt_device_down(). Hay dos errores en rose_rt_device_down() que pueden causar un use-after-free: 1. El límite del bucle `t-&gt;count` se modifica dentro del bucle, lo que puede provocar que el bucle termine antes de tiempo y se pierdan algunas entradas. 2. Al eliminar una entrada de la matriz de vecinos, las entradas posteriores se mueven hacia arriba para llenar el espacio vacío, pero el índice del bucle `i` aún se incrementa, lo que hace que se omita la siguiente entrada. Por ejemplo, si un nodo tiene tres vecinos (A, A, B) con count=3 y se está eliminando A, no se comprueba el segundo A. i=0: (A, A, B) -&gt; (A, B) con count=2 ^ comprobado i=1: (A, B) -&gt; (A, B) con count=2 ^ comprobado (¡B, no A!) i=2: (no ocurre porque i &lt; count es falso) Esto deja la segunda A en el array con count=2, pero la estructura rose_neigh se ha liberado. El código que accede a estas entradas asume que las primeras entradas de `count` son punteros válidos, lo que provoca un use-after-free al acceder al puntero colgante. Solucione ambos problemas iterando sobre el array en orden inverso con un límite de bucle fijo. Esto garantiza que se examinen todas las entradas y que la eliminación de una entrada no afecte a las iteraciones posteriores.","source":"nvd"}],"published":"2025-07-25T12:53:19.141Z","modified":"2026-08-05T12:01:27.739Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.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":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"94e0918e39039c47ddceb609500817f7266be756","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"fe62a35fb1f77f494ed534fc69a9043dc5a30ce1","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"2b952dbb32fef835756f07ff0cd77efbb836dfea","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"b6b232e16e08c6dc120672b4753392df0d28c1b4","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"7a1841c9609377e989ec41c16551309ce79c39e4","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"446ac00b86be1670838e513b643933d78837d8db","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"2c6c82ee074bfcfd1bc978ec45bfea37703d840a","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"34a500caf48c47d5171f4aa1f237da39b07c6157","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.12","status":"unaffected"},{"type":"semver","introduced":"5.4.296","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.240","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.187","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.144","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.97","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.37","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.6","lastAffected":"6.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.16","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":"2.6.13","fixed":"5.4.296"},{"status":"affected","introduced":"5.5","fixed":"5.10.240"},{"status":"affected","introduced":"5.11","fixed":"5.15.187"},{"status":"affected","introduced":"5.16","fixed":"6.1.144"},{"status":"affected","introduced":"6.2","fixed":"6.6.97"},{"status":"affected","introduced":"6.7","fixed":"6.12.37"},{"status":"affected","introduced":"6.13","fixed":"6.15.6"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"2.6.12"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/94e0918e39039c47ddceb609500817f7266be756","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fe62a35fb1f77f494ed534fc69a9043dc5a30ce1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2b952dbb32fef835756f07ff0cd77efbb836dfea","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b6b232e16e08c6dc120672b4753392df0d28c1b4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7a1841c9609377e989ec41c16551309ce79c39e4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/446ac00b86be1670838e513b643933d78837d8db","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2c6c82ee074bfcfd1bc978ec45bfea37703d840a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/34a500caf48c47d5171f4aa1f237da39b07c6157","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38377","url":"https://www.cve.org/CVERecord?id=CVE-2025-38377","licence":"CVE Terms of Use","modified":"2026-08-05T12:01:27.739Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38377","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38377","licence":"Public domain","modified":"2026-07-30T06:23:11.053Z"}],"updatedAt":"2026-11-25T22:59:01.675Z","epss":{"score":0.0025,"percentile":0.17508,"date":"2026-12-01T12:00:22.000Z"}}