Commit a50a85e4 authored by Florent Revest's avatar Florent Revest Committed by Daniel Borkmann

bpf: Expose bpf_sk_storage_* to iterator programs

Iterators are currently used to expose kernel information to userspace
over fast procfs-like files but iterators could also be used to
manipulate local storage. For example, the task_file iterator could be
used to initialize a socket local storage with associations between
processes and sockets or to selectively delete local storage values.
Signed-off-by: default avatarFlorent Revest <revest@google.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Acked-by: default avatarKP Singh <kpsingh@google.com>
Link: https://lore.kernel.org/bpf/20201204113609.1850150-3-revest@google.com
parent 4f19cab7
...@@ -394,6 +394,7 @@ static bool bpf_sk_storage_tracing_allowed(const struct bpf_prog *prog) ...@@ -394,6 +394,7 @@ static bool bpf_sk_storage_tracing_allowed(const struct bpf_prog *prog)
* use the bpf_sk_storage_(get|delete) helper. * use the bpf_sk_storage_(get|delete) helper.
*/ */
switch (prog->expected_attach_type) { switch (prog->expected_attach_type) {
case BPF_TRACE_ITER:
case BPF_TRACE_RAW_TP: case BPF_TRACE_RAW_TP:
/* bpf_sk_storage has no trace point */ /* bpf_sk_storage has no trace point */
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment