sys: FspFsvolQueryStreamInformationCopy: fix vulnerability reported by Abhinav Agarwal (GitHub @abhinavagarwal07)

Correct bounds checking on FSP_FSCTL_STREAM_INFO records.
This commit is contained in:
Bill Zissimopoulos
2026-07-27 16:19:10 +03:00
parent 1916d9bf06
commit a744d6f24c
+2 -1
View File
@@ -669,7 +669,8 @@ static NTSTATUS FspFsvolQueryStreamInformationCopy(
{ {
StreamInfoSize = StreamInfo->Size; StreamInfoSize = StreamInfo->Size;
if (sizeof(FSP_FSCTL_STREAM_INFO) > StreamInfoSize) if (sizeof(FSP_FSCTL_STREAM_INFO) > StreamInfoSize ||
(SIZE_T)(StreamInfoEnd - (PUINT8)StreamInfo) < StreamInfoSize)
break; break;
StreamNameLength = StreamInfoSize - sizeof(FSP_FSCTL_STREAM_INFO) + STREAM_EXTRA_LENGTH; StreamNameLength = StreamInfoSize - sizeof(FSP_FSCTL_STREAM_INFO) + STREAM_EXTRA_LENGTH;