KernelScan.io

HIGH

ksmbd QueryInfo OOB

CVE-2026-31433

CVSS 8.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI8.0HIGH

01

In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix potencial OOB in get_file_all_info() for compound requests When a compound request consists of QUERY_DIRECTORY + QUERY_INFO (FILE_ALL_INFORMATION) and the first command consumes nearly the entire max_trans_size, get_file_all_info() would blindly call smbConvertToUTF16() with PATH_MAX, causing out-of-bounds write beyond the response buffer. In get_file_all_info(), there was a missing validation check for the client-provided OutputBufferLength before copying the filename into FileName field of the smb2_file_all_info structure. If the filename length exceeds the available buffer space, it could lead to potential buffer overflows or memory corruption during smbConvertToUTF16 conversion. This calculating the actual free buffer size using smb2_calc_max_out_buf_len() and returning -EINVAL if the buffer is insufficient and updating smbConvertToUTF16 to use the actual filename length (clamped by PATH_MAX) to ensure a safe copy operation.

02

Engine v0.2.0

Risk summary

Remote authenticated SMB clients can trigger an out-of-bounds write in the ksmbd server by sending a crafted compound SMB2 request where a preceding command consumes most of the response buffer. This heap overflow can corrupt kernel memory and lead to denial of service (kernel panic) on systems running ksmbd.

Affectedfs/smb/server/smb2pdu.c (ksmbd)

Vulnerability analysis

The vulnerability exists in get_file_all_info() when handling compound SMB2 requests (QUERY_DIRECTORY followed by QUERY_INFO with FILE_ALL_INFORMATION). The code failed to validate the remaining response buffer space before calling smbConvertToUTF16() to copy the filename into the FileName field. When the first command in a compound request leaves insufficient space, the conversion writes up to PATH_MAX bytes beyond the allocated response buffer, resulting in a kernel heap overflow. The fix calculates the actual free buffer size with smb2_calc_max_out_buf_len(), rejects the request if space is insufficient, and clamps the conversion length to the real filename length.

03

BranchFixed inPatch commit
5.155.15.2033a852f9d1c98
6.16.1.1684cca3eff2099
6.126.12.807aec5a769d23
6.186.18.21b0cd9725fe2b
6.196.19.119d7032851d6f
6.66.6.131358cdaa1f7fb
mainline7.0beef2634f81f