History

selftests/bpf: Add missing trampoline program type to trampoline_count test

Currently the trampoline_count test doesn't include any fmod_ret bpf programs, fix it to make the test cover all possible trampoline program types. Since fmod_ret bpf programs can't be attached to __set_task_comm function, as it's neither whitelisted for error injection nor a security hook, change it to bpf_modify_return_test. This patch also does some other cleanups such as removing duplicate code, dropping inconsistent comments, etc.

Yuntao Wang committed 4 years ago

Commit b23316a1 parent 96af42c3 files · +61 −91Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/bpf.h+1−1
@@ -724,7 +724,7 @@ struct btf_func_model { · 723 unmodified lines
724724 #define BPF_TRAMP_F_RET_FENTRY_RET BIT(4)
725725
726726 /* Each call __bpf_prog_enter + call bpf_func + call __bpf_prog_exit is ~50
727− * bytes on x86. Pick a number to fit into BPF_IMAGE_SIZE / 2
727+ * bytes on x86.
728728 */
729729 #define BPF_MAX_TRAMP_LINKS 38
730730