User code cannot trigger syscall!

This commit is contained in:
Adrien Bourmault 2021-03-04 10:06:39 +01:00
parent 904492298f
commit fe6299097f
Signed by: neox
GPG Key ID: 6EB408FE0ACEC664
2 changed files with 4 additions and 6 deletions

View File

@ -366,12 +366,10 @@ error_t CmdRing3Test(int argc, char **argv, char *cmdline)
}
KernLog("Entrypoint : %p, stack address : %p\n", entryPoint, stackAddr+size);
extern void UserTest();
uchar *code = (uchar*)entryPoint;
*code = 0x90; // nop
*(code+1) = 0xEB; // jmp
*(code+2) = 0xFD; // short 0x0
memmove(entryPoint, UserTest, KPAGESIZE);
KeJumpToUserspace(0, entryPoint, stackAddr+size);

View File

@ -29,7 +29,7 @@ global EndOfUser
UserTest:
mov rdi, 13
int 0x80
;int 0x80
.clone:
nop