mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 17:31:31 +00:00
[NTOSKRNL] Guard against negative InformationClass enum values. CORE-15651
This commit is contained in:
parent
1a14dcb53f
commit
63977328b1
|
@ -2847,7 +2847,8 @@ NtQuerySystemInformation(
|
||||||
/*
|
/*
|
||||||
* Check if the request is valid.
|
* Check if the request is valid.
|
||||||
*/
|
*/
|
||||||
if (SystemInformationClass >= MAX_SYSTEM_INFO_CLASS)
|
if (SystemInformationClass < MIN_SYSTEM_INFO_CLASS ||
|
||||||
|
SystemInformationClass >= MAX_SYSTEM_INFO_CLASS)
|
||||||
{
|
{
|
||||||
_SEH2_YIELD(return STATUS_INVALID_INFO_CLASS);
|
_SEH2_YIELD(return STATUS_INVALID_INFO_CLASS);
|
||||||
}
|
}
|
||||||
|
@ -2871,7 +2872,8 @@ NtQuerySystemInformation(
|
||||||
/*
|
/*
|
||||||
* Check if the request is valid.
|
* Check if the request is valid.
|
||||||
*/
|
*/
|
||||||
if (SystemInformationClass >= MAX_SYSTEM_INFO_CLASS)
|
if (SystemInformationClass < MIN_SYSTEM_INFO_CLASS ||
|
||||||
|
SystemInformationClass >= MAX_SYSTEM_INFO_CLASS)
|
||||||
{
|
{
|
||||||
_SEH2_YIELD(return STATUS_INVALID_INFO_CLASS);
|
_SEH2_YIELD(return STATUS_INVALID_INFO_CLASS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2158,7 +2158,8 @@ NtQueryInformationFile(IN HANDLE FileHandle,
|
||||||
if (PreviousMode != KernelMode)
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
/* Validate the information class */
|
/* Validate the information class */
|
||||||
if ((FileInformationClass >= FileMaximumInformation) ||
|
if ((FileInformationClass < 0) ||
|
||||||
|
(FileInformationClass >= FileMaximumInformation) ||
|
||||||
!(IopQueryOperationLength[FileInformationClass]))
|
!(IopQueryOperationLength[FileInformationClass]))
|
||||||
{
|
{
|
||||||
/* Invalid class */
|
/* Invalid class */
|
||||||
|
@ -2192,7 +2193,8 @@ NtQueryInformationFile(IN HANDLE FileHandle,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Validate the information class */
|
/* Validate the information class */
|
||||||
if ((FileInformationClass >= FileMaximumInformation) ||
|
if ((FileInformationClass < 0) ||
|
||||||
|
(FileInformationClass >= FileMaximumInformation) ||
|
||||||
!(IopQueryOperationLength[FileInformationClass]))
|
!(IopQueryOperationLength[FileInformationClass]))
|
||||||
{
|
{
|
||||||
/* Invalid class */
|
/* Invalid class */
|
||||||
|
@ -2959,7 +2961,8 @@ NtSetInformationFile(IN HANDLE FileHandle,
|
||||||
if (PreviousMode != KernelMode)
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
/* Validate the information class */
|
/* Validate the information class */
|
||||||
if ((FileInformationClass >= FileMaximumInformation) ||
|
if ((FileInformationClass < 0) ||
|
||||||
|
(FileInformationClass >= FileMaximumInformation) ||
|
||||||
!(IopSetOperationLength[FileInformationClass]))
|
!(IopSetOperationLength[FileInformationClass]))
|
||||||
{
|
{
|
||||||
/* Invalid class */
|
/* Invalid class */
|
||||||
|
@ -2995,7 +2998,8 @@ NtSetInformationFile(IN HANDLE FileHandle,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Validate the information class */
|
/* Validate the information class */
|
||||||
if ((FileInformationClass >= FileMaximumInformation) ||
|
if ((FileInformationClass < 0) ||
|
||||||
|
(FileInformationClass >= FileMaximumInformation) ||
|
||||||
!(IopSetOperationLength[FileInformationClass]))
|
!(IopSetOperationLength[FileInformationClass]))
|
||||||
{
|
{
|
||||||
/* Invalid class */
|
/* Invalid class */
|
||||||
|
@ -3991,7 +3995,8 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle,
|
||||||
if (PreviousMode != KernelMode)
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
/* Validate the information class */
|
/* Validate the information class */
|
||||||
if ((FsInformationClass >= FileFsMaximumInformation) ||
|
if ((FsInformationClass < 0) ||
|
||||||
|
(FsInformationClass >= FileFsMaximumInformation) ||
|
||||||
!(IopQueryFsOperationLength[FsInformationClass]))
|
!(IopQueryFsOperationLength[FsInformationClass]))
|
||||||
{
|
{
|
||||||
/* Invalid class */
|
/* Invalid class */
|
||||||
|
@ -4163,7 +4168,8 @@ NtSetVolumeInformationFile(IN HANDLE FileHandle,
|
||||||
if (PreviousMode != KernelMode)
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
/* Validate the information class */
|
/* Validate the information class */
|
||||||
if ((FsInformationClass >= FileFsMaximumInformation) ||
|
if ((FsInformationClass < 0) ||
|
||||||
|
(FsInformationClass >= FileFsMaximumInformation) ||
|
||||||
!(IopSetFsOperationLength[FsInformationClass]))
|
!(IopSetFsOperationLength[FsInformationClass]))
|
||||||
{
|
{
|
||||||
/* Invalid class */
|
/* Invalid class */
|
||||||
|
|
Loading…
Reference in a new issue