mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:43:01 +00:00
NtSetSystemInformation: - Don't leak the copied string when being called from user mode. - Don't recursively call ZwSetSystemInformation, instead continue the normal path.
svn path=/trunk/; revision=39985
This commit is contained in:
parent
53899ff4fa
commit
36277461a1
1 changed files with 6 additions and 10 deletions
|
@ -1587,18 +1587,10 @@ SSI_DEF(SystemExtendServiceTableInformation)
|
||||||
/* FIXME: We can't, fail */
|
/* FIXME: We can't, fail */
|
||||||
//return STATUS_PRIVILEGE_NOT_HELD;
|
//return STATUS_PRIVILEGE_NOT_HELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Probe and capture the driver name */
|
|
||||||
ProbeAndCaptureUnicodeString(&ImageName, UserMode, Buffer);
|
|
||||||
|
|
||||||
/* Force kernel as previous mode */
|
|
||||||
return ZwSetSystemInformation(SystemExtendServiceTableInformation,
|
|
||||||
&ImageName,
|
|
||||||
sizeof(ImageName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Just copy the string */
|
/* Probe and capture the driver name */
|
||||||
ImageName = *(PUNICODE_STRING)Buffer;
|
ProbeAndCaptureUnicodeString(&ImageName, PreviousMode, Buffer);
|
||||||
|
|
||||||
/* Load the image */
|
/* Load the image */
|
||||||
Status = MmLoadSystemImage(&ImageName,
|
Status = MmLoadSystemImage(&ImageName,
|
||||||
|
@ -1607,6 +1599,10 @@ SSI_DEF(SystemExtendServiceTableInformation)
|
||||||
0,
|
0,
|
||||||
(PVOID)&ModuleObject,
|
(PVOID)&ModuleObject,
|
||||||
&ImageBase);
|
&ImageBase);
|
||||||
|
|
||||||
|
/* Release String */
|
||||||
|
ReleaseCapturedUnicodeString(&ImageName, PreviousMode);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Get the headers */
|
/* Get the headers */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue