]> git.baikalelectronics.ru Git - kernel.git/commit
ptrace, seccomp: tweak get_metadata behavior slightly
authorTycho Andersen <tycho@tycho.ws>
Wed, 21 Feb 2018 02:47:46 +0000 (19:47 -0700)
committerKees Cook <keescook@chromium.org>
Thu, 22 Feb 2018 00:56:03 +0000 (16:56 -0800)
commit5e912a26e776dff25bf0d0c51c69178349481705
treed26e642414ee3be9dbeb4d963b77a557eb62238b
parentee4e2743d18bd7f00b0c15fce7945ea9020a5279
ptrace, seccomp: tweak get_metadata behavior slightly

Previously if users passed a small size for the input structure size, they
would get get odd behavior. It doesn't make sense to pass a structure
smaller than at least filter_off size, so let's just give -EINVAL in this
case.

This changes userspace visible behavior, but was only introduced in commit
9690b4b9e2af ("ptrace, seccomp: add support for retrieving seccomp
metadata") in 4.16-rc2, so should be safe to change if merged before then.

Reported-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
CC: Kees Cook <keescook@chromium.org>
CC: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
kernel/seccomp.c