summaryrefslogtreecommitdiff
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@kernel.org>2026-06-12 02:00:00 +0300
committerSteve French <stfrench@microsoft.com>2026-06-17 02:57:22 +0300
commitbe6d26bf27499977c746abc163659915082348d8 (patch)
tree59d8df96b7f6bee40b08c9b3c4d904ed1b8fee7f /include/linux/string.h
parent388e4139db27a9e3612c9d356b826f5b1ff6a9e3 (diff)
downloadlinux-be6d26bf27499977c746abc163659915082348d8.tar.xz
ksmbd: serialize QUERY_DIRECTORY requests per file
smb2_query_dir() stores a pointer to its stack-allocated private data in the ksmbd_file readdir_data. Concurrent QUERY_DIRECTORY requests using the same file handle can overwrite this pointer while an iterate_dir() callback is still using it, resulting in a stack use-after-free. Add a per-file mutex and hold it while accessing the shared directory enumeration state. The lock covers scan restart, dot entry state, readdir_data setup and iteration, and response construction. This prevents another request from replacing readdir_data.private before the current request has finished using it and also serializes the shared file position. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-30527 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions