History

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.

Andrey Ignatov committed 7 years ago

Commit e1550bf1 parent 4e63acd5 files · +63 −8Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/bpf.h+3−0
@@ -3391,6 +3391,9 @@ struct bpf_sysctl { · 3390 unmodified lines
3391 __u32 write; /* Sysctl is being read (= 0) or written (= 1).3391 __u32 write; /* Sysctl is being read (= 0) or written (= 1).
3392 * Allows 1,2,4-byte read, but no write.3392 * Allows 1,2,4-byte read, but no write.
3393 */3393 */
3394 __u32 file_pos; /* Sysctl file position to read from, write to.
3395 * Allows 1,2,4-byte read an 4-byte write.
3396 */
3394};3397};
3395 3398
3396#endif /* _UAPI__LINUX_BPF_H__ */3399#endif /* _UAPI__LINUX_BPF_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t