mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
4e63acdff8
commit
e1550bfe0d
5 changed files with 63 additions and 8 deletions
|
@ -3391,6 +3391,9 @@ struct bpf_sysctl {
|
|||
__u32 write; /* Sysctl is being read (= 0) or written (= 1).
|
||||
* Allows 1,2,4-byte read, but no write.
|
||||
*/
|
||||
__u32 file_pos; /* Sysctl file position to read from, write to.
|
||||
* Allows 1,2,4-byte read an 4-byte write.
|
||||
*/
|
||||
};
|
||||
|
||||
#endif /* _UAPI__LINUX_BPF_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue