{"id":"CVE-2026-98112","state":"PUBLISHED","title":"ksmbd: fix listener task lifetime on netdev events","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix listener task lifetime on netdev events\n\nThe listener thread exits when its listening socket is shutdown. The\nnetdevice notifier shuts down the socket before calling kthread_stop(), so\nthe task_struct can be freed before kthread_stop() gets its reference.\n\nCreate the listener in a stopped state and hold an extra task_struct\nreference until kthread_stop_put() completes. Also stop and release\nlisteners before freeing their interface records during TCP teardown.","publishedAt":"2026-09-25T10:35:59.319Z","updatedAt":"2026-10-19T09:14:04.636Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3316a8fc840d82fad5efcf76ad0ea3f76fdca209","status":"affected","lessThan":"40581f10c1e56238b157af5f260b8f9518a0cbc1","versionType":"git"},{"version":"3316a8fc840d82fad5efcf76ad0ea3f76fdca209","status":"affected","lessThan":"a506290f59e1c6ce9ac0a13158640bb8fee93471","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/transport_tcp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"7.2.7","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/transport_tcp.c"]}],"references":["https://git.kernel.org/stable/c/40581f10c1e56238b157af5f260b8f9518a0cbc1","https://git.kernel.org/stable/c/a506290f59e1c6ce9ac0a13158640bb8fee93471"],"weaknesses":[],"ingestedAt":"2026-10-29T20:13:43.249Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/98xxx/CVE-2026-98112.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-98112","state":"PUBLISHED","datePublished":"2026-09-25T10:35:59.319Z","dateUpdated":"2026-10-19T09:14:04.636Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.316Z"},"containers":{"cna":{"title":"ksmbd: fix listener task lifetime on netdev events","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix listener task lifetime on netdev events\n\nThe listener thread exits when its listening socket is shutdown. The\nnetdevice notifier shuts down the socket before calling kthread_stop(), so\nthe task_struct can be freed before kthread_stop() gets its reference.\n\nCreate the listener in a stopped state and hold an extra task_struct\nreference until kthread_stop_put() completes. Also stop and release\nlisteners before freeing their interface records during TCP teardown."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3316a8fc840d82fad5efcf76ad0ea3f76fdca209","status":"affected","lessThan":"40581f10c1e56238b157af5f260b8f9518a0cbc1","versionType":"git"},{"version":"3316a8fc840d82fad5efcf76ad0ea3f76fdca209","status":"affected","lessThan":"a506290f59e1c6ce9ac0a13158640bb8fee93471","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/transport_tcp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"7.2.7","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/transport_tcp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/40581f10c1e56238b157af5f260b8f9518a0cbc1"},{"url":"https://git.kernel.org/stable/c/a506290f59e1c6ce9ac0a13158640bb8fee93471"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"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.\nAC: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.\nPR: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.\nUI: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.\nS: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.\nC: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.\nI: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.\nA: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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-19T09:14:04.636Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.2.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}