kern: add new KCapability checks before creating process

This commit is contained in:
Michael Scire 2022-03-22 14:45:29 -07:00 committed by SciresM
parent 14e768cd10
commit 8cb3cfd835
3 changed files with 48 additions and 5 deletions

View file

@ -192,6 +192,9 @@ namespace ams::kern::svc {
const bool is_application = (params.flags & ams::svc::CreateProcessFlag_IsApplication) != 0;
R_UNLESS(!optimize_allocs || is_application, svc::ResultBusy());
/* Check that the user-provided capabilities are accessible and refer to valid regions. */
R_TRY(KCapabilities::CheckCapabilities(user_caps, num_caps));
/* Get the current handle table. */
auto &handle_table = GetCurrentProcess().GetHandleTable();