]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add file_pos field to bpf_sysctl ctx
authorAndrey Ignatov <rdna@fb.com>
Fri, 8 Mar 2019 02:50:52 +0000 (18:50 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Apr 2019 20:54:58 +0000 (13:54 -0700)
commite3dba5ba2ebee4697879184fb63162e828b82476
tree417b3aa59134dff973b0b59f0cfdc1460284aed9
parent7d5bbf9955601b549a9068ccd4d0456c6b4892b7
bpf: Add file_pos field to bpf_sysctl ctx

Add file_pos field to bpf_sysctl context to read and write sysctl file
position at which sysctl is being accessed (read or written).

The field can be used to e.g. override whole sysctl value on write to
sysctl even when sys_write is called by user space with file_pos > 0. Or
BPF program may reject such accesses.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
fs/proc/proc_sysctl.c
include/linux/bpf-cgroup.h
include/linux/filter.h
include/uapi/linux/bpf.h
kernel/bpf/cgroup.c