Linux · Linux Kernel · CVE-2022-47939
**Name of the Vulnerable Software and Affected Versions**
Linux kernel versions 5.15 through 5.19 before 5.19.2
**Description**
A use-after-free issue exists in the Linux kernel's ksmbd module, specifically in the `fs/ksmbd/smb2pdu.c` file, related to the `SMB2 TREE DISCONNECT` command. This issue can be exploited by a remote attacker to execute arbitrary code on vulnerable Linux kernel versions. The ksmbd server, which implements the SMB3 protocol in the kernel for network file sharing, is affected when it handles `SMB2 TREE DISCONNECT` commands without properly checking the existence of an object before performing operations on it.
**Recommendations**
For Linux kernel versions 5.15 through 5.19 before 5.19.2, update to version 5.19.2 or later to resolve the issue.
As a temporary workaround, consider disabling the ksmbd server until a patch is available.
Restrict access to the `SMB2 TREE DISCONNECT` command to minimize the risk of exploitation.