Skip to content

Commit 64c8189

Browse files
Andrew Boiecarlescufi
authored andcommitted
userspace: fix bad ssf pointer on bad/no syscall
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]>
1 parent 36e70af commit 64c8189

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/userspace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static uintptr_t handler_bad_syscall(uintptr_t bad_id, uintptr_t arg2,
785785
void *ssf)
786786
{
787787
LOG_ERR("Bad system call id %" PRIuPTR " invoked", bad_id);
788-
arch_syscall_oops(_current->syscall_frame);
788+
arch_syscall_oops(ssf);
789789
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
790790
}
791791

@@ -794,7 +794,7 @@ static uintptr_t handler_no_syscall(uintptr_t arg1, uintptr_t arg2,
794794
uintptr_t arg5, uintptr_t arg6, void *ssf)
795795
{
796796
LOG_ERR("Unimplemented system call");
797-
arch_syscall_oops(_current->syscall_frame);
797+
arch_syscall_oops(ssf);
798798
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
799799
}
800800

0 commit comments

Comments
 (0)