]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: allow sleepable uprobe programs to attach
authorDelyan Kratunov <delyank@fb.com>
Tue, 14 Jun 2022 23:10:43 +0000 (23:10 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Jun 2022 02:27:29 +0000 (19:27 -0700)
commitb621e56b7f042b2d4c03caea397301dd874d9e2f
tree2919d1f75b3bff6aa6d91cf99c3866fe5deb25f9
parent7a4e70ec2aa53d24cf62052181476507c9dbf99f
bpf: allow sleepable uprobe programs to attach

uprobe and kprobe programs have the same program type, KPROBE, which is
currently not allowed to load sleepable programs.

To avoid adding a new UPROBE type, instead allow sleepable KPROBE
programs to load and defer the is-it-actually-a-uprobe-program check
to attachment time, where there's already validation of the
corresponding perf_event.

A corollary of this patch is that you can now load a sleepable kprobe
program but cannot attach it.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Link: https://lore.kernel.org/r/fcd44a7cd204f372f6bb03ef794e829adeaef299.1655248076.git.delyank@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c
kernel/events/core.c