CVE-2026-68137 PUBLISHED

net/x25: fix use-after-free in x25_kill_by_neigh()

Assigner: Linux
Reserved: 30.07.2026 Published: 10.08.2026 Updated: 10.08.2026

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

net/x25: fix use-after-free in x25_kill_by_neigh()

x25_kill_by_neigh() walks the global X.25 socket list looking for sockets attached to a terminating neighbour. x25_list_lock protects list membership while the lookup is in progress, but it does not pin a socket's lifetime after the lock is dropped.

The function currently drops x25_list_lock before calling lock_sock(s). A concurrent close can run x25_release(), remove the same socket from x25_list, and drop the last socket reference in that window. The neighbour teardown path can then lock or inspect a freed struct sock/struct x25_sock.

Take sock_hold(s) while x25_list_lock still proves that the list entry is live, then drop the temporary reference after the socket has been locked, rechecked, and released. Recheck x25_sk(s)->neighbour after lock_sock(), because another path may have disconnected the socket before this path acquired the socket lock. Restart the list walk after each disconnect because the list lock was dropped and the previous iterator state may no longer be valid.

A QEMU/KASAN run against origin/master reproduced a slab-use-after-free in x25_kill_by_neigh().

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 7781607938c8371d4c2b243527430241c62e39c2 to 3f4fe26c20c30bd5a2e2583e80685def0b27858c (excl.)
  • affected from 7781607938c8371d4c2b243527430241c62e39c2 to 610678d4be94b619c751572e8a58de705592cd07 (excl.)
  • affected from 7781607938c8371d4c2b243527430241c62e39c2 to ec6d91a1bf2ebd767d3d43f6d249ee0ed3f4558a (excl.)
  • affected from 7781607938c8371d4c2b243527430241c62e39c2 to 9aabda553184346f74810e2ee1d96920b4612e3f (excl.)
  • affected from 7781607938c8371d4c2b243527430241c62e39c2 to 5499e0602d2faafd42c580d25f615903c3fbe11b (excl.)
  • Version dffc859d1d9560da594e4282091781b8d2715f00 is affected
  • Version 858642789ada1b48630f322e59416ca9fca3e6b7 is affected
  • Version 4c240c5a105557e4546d0836e694868f22fd09b0 is affected
  • Version 9acf05b4e7b55fdb712ef7b331dbce5bcd391d0f is affected
  • Version 5c94b6205e87411dbe9dc1ca088eb36b8837fb47 is affected
  • Version 409570a619c1cda2e0fde6018a256b9e3d3ba0ee is affected
  • Version 4a279d7ee1c65411b4055ecd428b8aa2b1711c1f is affected
  • Version 671529db75e6be777bb1c76aa07c2bdd2992be6d is affected
  • affected from 4.9.311 to 4.10 (excl.)
  • affected from 4.14.276 to 4.15 (excl.)
  • affected from 4.19.238 to 4.20 (excl.)
  • affected from 5.4.189 to 5.5 (excl.)
  • affected from 5.10.110 to 5.11 (excl.)
  • affected from 5.15.33 to 5.16 (excl.)
  • affected from 5.16.19 to 5.17 (excl.)
  • affected from 5.17.2 to 5.18 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.18 is affected
  • unaffected from 0 to 5.18 (excl.)
  • unaffected from 6.6.148 to 6.6.* (incl.)
  • unaffected from 6.12.101 to 6.12.* (incl.)
  • unaffected from 6.18.42 to 6.18.* (incl.)
  • unaffected from 7.1.6 to 7.1.* (incl.)
  • unaffected from 7.2-rc5 to * (incl.)

References