[PATCH bpf-next v3 2/2] bpf: allow bpf_current_task_under_cgroup() with BPF_CGROUP_*

2024-07-24 Thread technoboy85
From: Matteo Croce The helper bpf_current_task_under_cgroup() currently is only allowed for tracing programs. Allow its usage also in the BPF_CGROUP_* program types. Move the code from kernel/trace/bpf_trace.c to kernel/bpf/helpers.c, so it compiles also without CONFIG_BPF_EVENTS. This will be u

[PATCH bpf-next v3 1/2] bpf: enable generic kfuncs for BPF_CGROUP_* programs

2024-07-24 Thread technoboy85
From: Matteo Croce These kfuncs are enabled even in BPF_PROG_TYPE_TRACING, so they should be safe also in BPF_CGROUP_* programs. Acked-by: Andrii Nakryiko Signed-off-by: Matteo Croce --- kernel/bpf/helpers.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/bpf/helpers.c b/kern

[PATCH bpf-next v3 0/2] bpf: enable some functions in cgroup programs

2024-07-24 Thread technoboy85
From: Matteo Croce Enable some BPF kfuncs and the helper bpf_current_task_under_cgroup() for program types BPF_CGROUP_*. These will be used by systemd-networkd: https://github.com/systemd/systemd/pull/32212 Matteo Croce (2): bpf: enable generic kfuncs for BPF_CGROUP_* programs bpf: allow bpf

[PATCH bpf-next v2 2/2] bpf: allow bpf_current_task_under_cgroup() with BPF_CGROUP_*

2024-07-22 Thread technoboy85
From: Matteo Croce The helper bpf_current_task_under_cgroup() currently is only allowed for tracing programs. Allow its usage also in the BPF_CGROUP_* program types. Move the code from kernel/trace/bpf_trace.c to kernel/bpf/helpers.c, so it compiles also without CONFIG_BPF_EVENTS. This will be u

[PATCH bpf-next v2 1/2] bpf: enable generic kfuncs for BPF_CGROUP_* programs

2024-07-22 Thread technoboy85
From: Matteo Croce These kfuncs are enabled even in BPF_PROG_TYPE_TRACING, so they should be safe also in BPF_CGROUP_* programs. Signed-off-by: Matteo Croce --- kernel/bpf/helpers.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index b5f0

[PATCH bpf-next v2 0/2] bpf: enable some functions in cgroup programs

2024-07-22 Thread technoboy85
From: Matteo Croce Enable some BPF kfuncs and the helper bpf_current_task_under_cgroup() for program types BPF_CGROUP_*. These will be used by systemd-networkd: https://github.com/systemd/systemd/pull/32212 Matteo Croce (2): bpf: enable generic kfuncs for BPF_CGROUP_* programs bpf: allow bpf

[PATCH bpf-next] bpf: allow bpf_current_task_under_cgroup() with BPF_CGROUP_*

2024-07-22 Thread technoboy85
From: Matteo Croce The helper bpf_current_task_under_cgroup() currently is only allowed for tracing programs. Allow its usage also in the BPF_CGROUP_* program types. Move the code from kernel/trace/bpf_trace.c to kernel/bpf/cgroup.c, so it compiles also without CONFIG_BPF_EVENTS. Signed-off-by: