linux/fs/proc
Andrey Ignatov 4e63acdff8 bpf: Introduce bpf_sysctl_{get,set}_new_value helpers
Add helpers to work with new value being written to sysctl by user
space.

bpf_sysctl_get_new_value() copies value being written to sysctl into
provided buffer.

bpf_sysctl_set_new_value() overrides new value being written by user
space with a one from provided buffer. Buffer should contain string
representation of the value, similar to what can be seen in /proc/sys/.

Both helpers can be used only on sysctl write.

File position matters and can be managed by an interface that will be
introduced separately. E.g. if user space calls sys_write to a file in
/proc/sys/ at file position = X, where X > 0, then the value set by
bpf_sysctl_set_new_value() will be written starting from X. If program
wants to override whole value with specified buffer, file position has
to be set to zero.

Documentation for the new helpers is provided in bpf.h UAPI.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-04-12 13:54:58 -07:00
..
array.c proc: use seq_puts() everywhere 2019-03-05 21:07:22 -08:00
base.c ptrace: Remove maxargs from task_current_syscall() 2019-04-04 09:17:15 -04:00
cmdline.c proc: introduce proc_create_single{,_data} 2018-05-16 07:23:35 +02:00
consoles.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
cpuinfo.c x86 / CPU: Always show current CPU frequency in /proc/cpuinfo 2017-11-15 19:46:50 +01:00
devices.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
fd.c proc: use "unsigned int" in proc_fill_cache() 2018-06-07 17:34:38 -07:00
fd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
generic.c proc: fix /proc/net/* after setns(2) 2019-02-01 15:46:22 -08:00
inode.c proc: Add fs_context support to procfs 2019-02-28 03:29:28 -05:00
internal.h Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-03-12 14:08:19 -07:00
interrupts.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
Kconfig proc/kcore: add vmcoreinfo note to /proc/kcore 2018-08-22 10:52:46 -07:00
kcore.c fs/proc/kcore.c: make kcore_modules static 2019-03-29 10:01:37 -07:00
kmsg.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
loadavg.c sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD 2018-10-26 16:26:32 -07:00
Makefile proc: : uninline name_to_int() 2017-11-17 16:10:00 -08:00
meminfo.c mm, proc: add KReclaimable to /proc/meminfo 2018-10-26 16:26:32 -07:00
namespaces.c procfs: switch instantiate_t to d_splice_alias() 2018-05-26 14:20:50 -04:00
nommu.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
page.c mm: convert PG_balloon to PG_offline 2019-03-05 21:07:14 -08:00
proc_net.c proc: fix /proc/net/* after setns(2) 2019-02-01 15:46:22 -08:00
proc_sysctl.c bpf: Introduce bpf_sysctl_{get,set}_new_value helpers 2019-04-12 13:54:58 -07:00
proc_tty.c tty: replace ->proc_fops with ->proc_show 2018-05-16 07:24:30 +02:00
root.c Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-03-12 14:08:19 -07:00
self.c fs/proc/self.c: code cleanup for proc_setup_self() 2019-03-05 21:07:21 -08:00
softirqs.c proc: introduce proc_create_single{,_data} 2018-05-16 07:23:35 +02:00
stat.c Merge branch 'akpm' (patches from Andrew) 2019-03-06 10:31:36 -08:00
task_mmu.c 5.1 Merge Window Pull Request 2019-03-09 15:53:03 -08:00
task_nommu.c Merge branch 'akpm' (patches from Andrew) 2019-03-06 10:31:36 -08:00
thread_self.c fs/proc/thread_self.c: code cleanup for proc_setup_thread_self() 2019-03-05 21:07:21 -08:00
uptime.c fs/proc/uptime.c: use ktime_get_boottime_ts64 2018-08-22 10:52:45 -07:00
util.c fs/proc/util.c: include fs/proc/internal.h for name_to_int() 2019-01-04 13:13:45 -08:00
version.c proc: introduce proc_create_single{,_data} 2018-05-16 07:23:35 +02:00
vmcore.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00