A new flaw has been discovered in the processing of SMB2_TREE_DISCONNECT commands which can lead to remote code execution in servers with ksmbd enabled. KSMBD is an in-kernel SMB file server that was mostly written by a team at Samsung Electronics that was merged into the 5.15 kernel on August 29, 2021. This kernel server implements the SMB3 protocol in kernel space for the sharing of files over a network.
This new vulnerability was discovered back in July 2022 but was only disclosed to the public on December 22, 2022. The good news is twofold:
A new local privilege escalation vulnerability has been discovered in the Linux kernel and users are encouraged to upgrade/patch immediately.
RedHat added a new CVE code, listed as 2022-3977, which is described as a use-after-free flaw. A use-after flaw can occur when a program attempts to use memory that has been released.
CVE 2022-3977 resides in the Linux kernel MCTP (Management Component Transport Protocol). How this vulnerability works is after a user simultaneously calls DROPTAG ioctl at the same time a socket close occurs. When this happens, the vulnerability can then be used to elevate privileges all the way up to root.
This CVE has been listed as Moderate, with a CVSS v3 base score of 7.0 and the vulnerability was found in the most recent upstream Linux kernel.
It was the Active Defense Lab of Venustech that originally reported the vulnerability, finding it came into being in v5.18.0 with the commit 63ed1aab3d40aa61aaa66819bdce9377ac7f40fa. Fortunately, with a recent commit, the vulnerability has been patched.