CVE-2026-98112 PUBLISHED

ksmbd: fix listener task lifetime on netdev events

Assigner: Linux
Reserved: 25.09.2026 Published: 25.09.2026 Updated: 25.09.2026

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

ksmbd: fix listener task lifetime on netdev events

The listener thread exits when its listening socket is shutdown. The netdevice notifier shuts down the socket before calling kthread_stop(), so the task_struct can be freed before kthread_stop() gets its reference.

Create the listener in a stopped state and hold an extra task_struct reference until kthread_stop_put() completes. Also stop and release listeners before freeing their interface records during TCP teardown.

Metrics

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.8

AV:L - The bug is kthread_stop() on an already-exited listener, reached from ksmbd_netdev_event(NETDEV_DOWN). That event comes from local rtnetlink link up/down. No SMB message carries attacker data to this path, so it is not remote. AC:L - The attacker starts the race: kernel_sock_shutdown() makes the listener exit before kthread_stop() takes its reference. The attacker can repeat it at will by toggling a same-named link. Each NETDEV_UP makes create_socket() start a new listener, so the narrow window can be retried as many times as needed. PR:L - ksmbd_netdev_event() matches iface names without checking the network namespace. An unprivileged user in unshare -Urn can down their own lo, or a veth named like a host interface, with only CAP_NET_ADMIN inside the user namespace, and so run the teardown of the host listener. UI:N - Nothing is needed from an admin or victim beyond ksmbd already running. The attacker sends the netlink link up/down requests themselves inside their own network namespace. S:U - This is memory corruption inside the kernel that leads to local privilege escalation or a crash within the same kernel authority. It does not cross a hypervisor or other separate security boundary. C:H - After the listener task_struct is freed and reallocated, kthread_stop() reads to_kthread(k) and kthread->result through a dangling pointer. The attacker can control the reclaimed object, which enables kernel memory disclosure. I:H - kthread_stop() writes to freed memory: it increments the refcount, does set_bit() on kthread->flags, then calls wake_up_process() and put_task_struct() on the stale task. This corrupts whatever object has reclaimed the memory and can be groomed into a write or an extra free. A:H - Using the freed task_struct/kthread in kthread_stop() under rtnl can cause an oops, a refcount underflow or a hang. Each trigger also tears down ksmbd's real host listener on port 445, so the server stops accepting connections.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 3316a8fc840d82fad5efcf76ad0ea3f76fdca209 to 40581f10c1e56238b157af5f260b8f9518a0cbc1 (excl.)
  • affected from 3316a8fc840d82fad5efcf76ad0ea3f76fdca209 to a506290f59e1c6ce9ac0a13158640bb8fee93471 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.19 is affected
  • unaffected from 0 to 6.19 (excl.)
  • unaffected from 7.2.7 to 7.2.* (incl.)
  • unaffected from 7.3-rc2 to * (incl.)

References