reactos/ntoskrnl/se
George Bișoc d0d86ab588
[NTOSKRNL] Force a probe against ReturnLength on query & Misc ICIF stuff
NtQueryInformationToken is by far the only system call in NT where ReturnLength simply cannot be optional. On Windows this parameter is always probed and an argument to NULL directly leads to an access violation exception.
This is due to the fact of how tokens work, as its information contents (token user, owner, primary group, et al) are dynamic and can vary throughout over time in memory.

What happens on current ReactOS master however is that ReturnLength is only probed if the parameter is not NULL. On a NULL case scenario the probing checks succeed and NtQueryInformationToken fails later. For this, just get rid of CompleteProbing
parameter and opt in for a bit mask flag based approach, with ICIF_FORCE_RETURN_LENGTH_PROBE being set on DefaultQueryInfoBufferCheck which NtQueryInformationToken calls it to do sanity checks.

In addition to that...

- Document the ICIF probe helpers
- Annotate the ICIF prope helpers with SAL
- With the riddance of CompleteProbing and adoption of flags based approach, add ICIF_PROBE_READ_WRITE and ICIF_PROBE_READ flags alongside with ICIF_FORCE_RETURN_LENGTH_PROBE
2022-06-12 11:05:05 +02:00
..
access.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
accesschk.c [NTOS:SE] Deny access to the caller if access is not allowed by the object 2022-05-06 10:09:53 +02:00
acl.c [NTOS:SE] SepCaptureAcl(): Add missing validation of the captured ACL (#4523) 2022-05-23 19:30:34 +02:00
audit.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
client.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
objtype.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
priv.c [NTOS:SE] Assign the captured SID and/or privileges to NULL manually on token filtering 2022-02-10 09:51:58 +01:00
sd.c [NTOS:SE] SeValidSecurityDescriptor(): Add missing validation aspects (#4523) 2022-05-23 19:30:33 +02:00
semgr.c [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
sid.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
sqos.c [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
srm.c [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
subject.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
token.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
tokenadj.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00
tokencls.c [NTOSKRNL] Force a probe against ReturnLength on query & Misc ICIF stuff 2022-06-12 11:05:05 +02:00
tokenlif.c [NTOS:SE] Reorganize the security manager component 2022-05-29 20:22:19 +02:00