Kernel: When userspaces calls a removed syscall, fail with ENOSYS

This is a bit gentler than jumping to 0x0, which always crashes the
whole process. Also log a debug message about what happened, and let
the user know that it's probably time to rebuild the program.
This commit is contained in:
Andreas Kling 2019-11-18 12:35:14 +01:00
parent 040fee370d
commit c23addd1fb

View file

@ -86,6 +86,10 @@ int handle(RegisterDump& regs, u32 function, u32 arg1, u32 arg2, u32 arg3)
return -ENOSYS;
}
if (s_syscall_table[function] == nullptr) {
dbg() << process << ": Null syscall " << function << " requested: \"" << to_string((Function)function) << "\", you probably need to rebuild this program.";
return -ENOSYS;
}
return (process.*(s_syscall_table[function]))(arg1, arg2, arg3);
}