replace ad hoc driver loading with a proper driver manager, new DDK, new PnP manager with device matching, asynchronous startup, resource ownership and removal, add shared PCI capability helpers, replace typed, rigid services with a proper service manager, implement proper system shutdown and restart, shutting down unloads drivers and shuts down services, add simple power button, remove heavyweight boot self-tests and SMP stress runs, add monotonic timestamps to kernel debug output, fruitless USB and PS/2 fixes, make test builds opt in.
This commit is contained in:
1 parent
c0ad63c27f
commit
d36f19509c
160 files changed
+6563
-7366
No files matched your search
@@ -86,8 +86,7 @@ static int run_restricted_child(uint32_t parentPid) {
|
||||
info.Size = sizeof(info);
|
||||
KSTATUS status = SysQuerySecurityContext(SYS_SECURITY_CONTEXT_CURRENT, &info);
|
||||
if (!KSUCCESS(status)) return 10;
|
||||
if (info.EffectivePrivileges || info.DelegablePrivileges ||
|
||||
info.ServiceClaims || info.DelegableServiceClaims)
|
||||
if (info.EffectivePrivileges || info.DelegablePrivileges)
|
||||
return 11;
|
||||
|
||||
SYS_HANDLE process = SYS_HANDLE_INVALID;
|
||||
@@ -145,9 +144,9 @@ static int run_restricted_child(uint32_t parentPid) {
|
||||
createPort.HandleOut = &listener;
|
||||
status = SysCreatePort(&createPort);
|
||||
if (!KSUCCESS(status)) return 25;
|
||||
status = SysRegisterSystemService(SYS_SERVICE_RESOURCE, listener);
|
||||
status = SysRegisterSystemService(SYS_HANDLE_INVALID, listener);
|
||||
(void)SysCloseHandle(listener);
|
||||
if (status != NTLSTATUS_ACCESS_DENIED) return 26;
|
||||
if (status != NTLSTATUS_INVALID_HANDLE) return 26;
|
||||
|
||||
uint32_t selfPid = SysGetCurrentPid();
|
||||
status = SysOpenProcess(selfPid, SYS_RIGHT_QUERY, &process);
|
||||
@@ -188,9 +187,7 @@ static int run_parent(void) {
|
||||
KSTATUS status = SysQuerySecurityContext(SYS_SECURITY_CONTEXT_CURRENT, &rootInfo);
|
||||
if (!KSUCCESS(status)) fail_status("query current context", status);
|
||||
if (rootInfo.EffectivePrivileges != SYS_PRIV_ALL ||
|
||||
rootInfo.DelegablePrivileges != SYS_PRIV_ALL ||
|
||||
rootInfo.ServiceClaims != SYS_SERVICE_CLAIM_ALL ||
|
||||
rootInfo.DelegableServiceClaims != SYS_SERVICE_CLAIM_ALL)
|
||||
rootInfo.DelegablePrivileges != SYS_PRIV_ALL)
|
||||
fail_status("bootstrap context authority", NTLSTATUS_FAILURE);
|
||||
|
||||
SYS_HANDLE selfProcess = SYS_HANDLE_INVALID;
|
||||
@@ -209,9 +206,7 @@ static int run_parent(void) {
|
||||
if (!KSUCCESS(status)) fail_status("query exact process security context", status);
|
||||
if (exactInfo.SecurityId != rootInfo.SecurityId ||
|
||||
exactInfo.EffectivePrivileges != rootInfo.EffectivePrivileges ||
|
||||
exactInfo.DelegablePrivileges != rootInfo.DelegablePrivileges ||
|
||||
exactInfo.ServiceClaims != rootInfo.ServiceClaims ||
|
||||
exactInfo.DelegableServiceClaims != rootInfo.DelegableServiceClaims)
|
||||
exactInfo.DelegablePrivileges != rootInfo.DelegablePrivileges)
|
||||
fail_status("exact process security context identity", NTLSTATUS_FAILURE);
|
||||
(void)SysCloseHandle(exactContext);
|
||||
(void)SysCloseHandle(selfProcess);
|
||||
@@ -232,8 +227,7 @@ static int run_parent(void) {
|
||||
status = SysQuerySecurityContext(restricted, &restrictedInfo);
|
||||
if (!KSUCCESS(status)) fail_status("query stripped context", status);
|
||||
if (restrictedInfo.SecurityId <= rootInfo.SecurityId ||
|
||||
restrictedInfo.EffectivePrivileges || restrictedInfo.DelegablePrivileges ||
|
||||
restrictedInfo.ServiceClaims || restrictedInfo.DelegableServiceClaims)
|
||||
restrictedInfo.EffectivePrivileges || restrictedInfo.DelegablePrivileges)
|
||||
fail_status("stripped context contents", NTLSTATUS_FAILURE);
|
||||
|
||||
SYS_HANDLE illegal = SYS_HANDLE_INVALID;
|
||||
@@ -247,15 +241,6 @@ static int run_parent(void) {
|
||||
if (status != NTLSTATUS_ACCESS_DENIED)
|
||||
fail_status("blocked privilege amplification", status);
|
||||
|
||||
memset(&lify, 0, sizeof(amplify));
|
||||
amplify.Size = sizeof(amplify);
|
||||
amplify.SourceContext = restricted;
|
||||
amplify.ServiceClaims = SYS_SERVICE_CLAIM_RESOURCE;
|
||||
amplify.ContextHandleOut = &illegal;
|
||||
status = SysDeriveSecurityContext(&lify);
|
||||
if (status != NTLSTATUS_ACCESS_DENIED)
|
||||
fail_status("blocked service-claim amplification", status);
|
||||
|
||||
SYS_HANDLE queryOnly = SYS_HANDLE_INVALID;
|
||||
SYS_DERIVE_HANDLE_REQUEST deriveHandle = {
|
||||
sizeof(deriveHandle), restricted, SYS_RIGHT_QUERY, &queryOnly
|
||||
|
||||
Reference in new issue
Block a user