Skip to content

Commit

Permalink
bpf: Reject replace_bpf_fd in bpf_prog_detach
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenz Bauer <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
  • Loading branch information
lmb authored and borkmann committed Oct 5, 2023
1 parent 2a4b361 commit 9b5df4c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/bpf/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -3871,6 +3871,8 @@ static int bpf_prog_detach(const union bpf_attr *attr)

if (CHECK_ATTR(BPF_PROG_DETACH))
return -EINVAL;
if (attr->replace_bpf_fd)
return -EINVAL;

ptype = attach_type_to_prog_type(attr->attach_type);
if (bpf_mprog_supported(ptype)) {
Expand Down

0 comments on commit 9b5df4c

Please sign in to comment.