diff options
| author | Namjae Jeon <linkinjeon@kernel.org> | 2026-06-12 02:00:00 +0300 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-06-17 02:57:22 +0300 |
| commit | be6d26bf27499977c746abc163659915082348d8 (patch) | |
| tree | 59d8df96b7f6bee40b08c9b3c4d904ed1b8fee7f /include/linux/start_kernel.h | |
| parent | 388e4139db27a9e3612c9d356b826f5b1ff6a9e3 (diff) | |
| download | linux-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/start_kernel.h')
0 files changed, 0 insertions, 0 deletions
