Skip to content

Commit

Permalink
userspace: fix bad ssf pointer on bad/no syscall
Browse files Browse the repository at this point in the history
This was passing along _current->ssf, but these types of bad
syscalls do not go through the z_mrsh mechanism and was
passing stale data.

We have the syscall stack frame already as an argument,
propagate that so it works properly.

Signed-off-by: Andrew Boie <[email protected]>
  • Loading branch information
Andrew Boie authored and carlescufi committed Jun 3, 2020
1 parent 36e70af commit 64c8189
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ static uintptr_t handler_bad_syscall(uintptr_t bad_id, uintptr_t arg2,
void *ssf)
{
LOG_ERR("Bad system call id %" PRIuPTR " invoked", bad_id);
arch_syscall_oops(_current->syscall_frame);
arch_syscall_oops(ssf);
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
}

Expand All @@ -794,7 +794,7 @@ static uintptr_t handler_no_syscall(uintptr_t arg1, uintptr_t arg2,
uintptr_t arg5, uintptr_t arg6, void *ssf)
{
LOG_ERR("Unimplemented system call");
arch_syscall_oops(_current->syscall_frame);
arch_syscall_oops(ssf);
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
}

Expand Down

0 comments on commit 64c8189

Please sign in to comment.