diff options
author | Song Liu <song@kernel.org> | 2023-12-06 14:40:48 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-12-06 17:17:20 -0800 |
commit | f08a1c658257c73697a819c4ded3a84b6f0ead74 (patch) | |
tree | 447d1a173b1f692cb45d232801e1d855adf315fc /include | |
parent | 7065eefb38f16c91e9ace36fb7c873e4c9857c27 (diff) | |
download | linux-stable-f08a1c658257c73697a819c4ded3a84b6f0ead74.tar.gz linux-stable-f08a1c658257c73697a819c4ded3a84b6f0ead74.tar.bz2 linux-stable-f08a1c658257c73697a819c4ded3a84b6f0ead74.zip |
bpf: Let bpf_prog_pack_free handle any pointer
Currently, bpf_prog_pack_free only can only free pointer to struct
bpf_binary_header, which is not flexible. Add a size argument to
bpf_prog_pack_free so that it can handle any pointer.
Signed-off-by: Song Liu <song@kernel.org>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com> # on s390x
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20231206224054.492250-2-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/filter.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 14354605ad26..12d907f17d36 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -1067,7 +1067,7 @@ struct bpf_binary_header * bpf_jit_binary_pack_hdr(const struct bpf_prog *fp); void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns); -void bpf_prog_pack_free(struct bpf_binary_header *hdr); +void bpf_prog_pack_free(void *ptr, u32 size); static inline bool bpf_prog_kallsyms_verify_off(const struct bpf_prog *fp) { |