]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Extend check_uarg_tail_zero() checks
authorMickaël Salaün <mic@digikod.net>
Mon, 7 Aug 2017 18:45:20 +0000 (20:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Aug 2017 01:11:17 +0000 (18:11 -0700)
commit4b0cbcb8d811986ea9f07529516eb5603fc543c1
tree5ee1b20c2245bc4a75281a2323807642793ed49b
parent92b67279f5951da99ffc7d9b24d4d05176ce756e
bpf: Extend check_uarg_tail_zero() checks

The function check_uarg_tail_zero() was created from bpf(2) for
BPF_OBJ_GET_INFO_BY_FD without taking the access_ok() nor the PAGE_SIZE
checks. Make this checks more generally available while unlikely to be
triggered, extend the memory range check and add an explanation
including why the ToCToU should not be a security concern.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Link: https://lkml.kernel.org/r/CAGXu5j+vRGFvJZmjtAcT8Hi8B+Wz0e1b6VKYZHfQP_=DXzC4CQ@mail.gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/syscall.c