Issue
So I am assuming that BPF_PROG_TYPE_SYSCALL
programs are triggered whenever a particular syscall is executed inside the kernel. Can't BPF_PROG_TYPE_KPROBE
ebpf programs be used for that purpose? kprobes can hook into any kernel function and syscalls are also kernel functions.
So what is the difference between the two types of programs and when to use which?
Solution
You would think that but actually BPF_PROG_TYPE_SYSCALL
is a program type which can execute syscalls itself. https://lwn.net/Articles/854228/ It was introduced as an attempt to make one BPF program load another so the first program can be signed with a certificate. But it hasn't caught on very well yet as of writing this.
Indeed if you want to trigger on syscall execution, kprobes are the way to go.
Answered By - Dylan Reimerink Answer Checked By - Senaida (WPSolving Volunteer)