diff options
author | Andrey Ignatov <rdna@fb.com> | 2019-03-07 18:50:52 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-12 13:54:58 -0700 |
commit | e1550bfe0de47e30484ba91de1e50a91ec1c31f5 (patch) | |
tree | 417b3aa59134dff973b0b59f0cfdc1460284aed9 /include/linux/filter.h | |
parent | bpf: Introduce bpf_sysctl_{get,set}_new_value helpers (diff) | |
download | wireguard-linux-e1550bfe0de47e30484ba91de1e50a91ec1c31f5.tar.xz wireguard-linux-e1550bfe0de47e30484ba91de1e50a91ec1c31f5.zip |
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>
Diffstat (limited to 'include/linux/filter.h')
-rw-r--r-- | include/linux/filter.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index a23653f9460c..fb0edad75971 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -1188,6 +1188,9 @@ struct bpf_sysctl_kern { size_t new_len; int new_updated; int write; + loff_t *ppos; + /* Temporary "register" for indirect stores to ppos. */ + u64 tmp_reg; }; #endif /* __LINUX_FILTER_H__ */ |