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.
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.
| Attack Vector |
Local |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
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.
CVSS 3.1