diff options
author | Michael Pratt <mpratt@google.com> | 2020-01-28 11:12:01 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-28 11:26:09 -0800 |
commit | 76483b8b1ec4ee1fb6b6efb6bdcfaf6dba7be4ce (patch) | |
tree | ecdfac3908cf924499421e2a0abe10fb616b1ecc /pkg/sentry/syscalls/linux | |
parent | 74e04506a430535b7f3461eb35f36c9398db735a (diff) |
Check sigsetsize in rt_sigaction
This isn't in the libc wrapper, but it is in the syscall itself.
Discovered by @xiaobo55x in #1625.
PiperOrigin-RevId: 291973931
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_signal.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_signal.go b/pkg/sentry/syscalls/linux/sys_signal.go index 209be2990..7e1747a0c 100644 --- a/pkg/sentry/syscalls/linux/sys_signal.go +++ b/pkg/sentry/syscalls/linux/sys_signal.go @@ -245,6 +245,11 @@ func RtSigaction(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.S sig := linux.Signal(args[0].Int()) newactarg := args[1].Pointer() oldactarg := args[2].Pointer() + sigsetsize := args[3].SizeT() + + if sigsetsize != linux.SignalSetSize { + return 0, nil, syserror.EINVAL + } var newactptr *arch.SignalAct if newactarg != 0 { |