(CVE-2022-0168) Linux Kernel smb2_ioctl_query_info NULL Pointer Dereference
The CIFS/SMB2 ioctl handler smb2_ioctl_query_info mishandles the result of memdup_user when the user-supplied output buffer length is zero, so an invalid pointer passes a validity check. An attacker able to issue this ioctl on a CIFS file could trigger a NULL pointer dereference in the kernel.
starlabs.sg
Published on starlabs.sg
Common Internet File System (CIFS) is a network filesystem protocol used for providing shared access to files and printers between machines on the network. A CIFS client application can read, write, edit and even remove files on the remote server.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the return value of memdup_user is checked with a test that treats the zero-length error pointer as valid, because the user-controlled output buffer length can be zero.
Impact
A user able to call this ioctl on a CIFS file could cause a kernel NULL pointer dereference, potentially crashing or destabilising the system.
What the attacker needed
Ability to issue ioctl on a CIFS file; a mounted CIFS/SMB share
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A network filesystem lets one machine read and write files on another. When a program asks the kernel for information about a file on such a share, the kernel copies a small buffer from the program and then checks whether that copy succeeded. Here the check is wrong for one special case (a zero-length request), so the kernel carries on with a pointer that does not point to real memory and crashes.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.