bpf: fix bpf_shim_tramp_link_release ifdef guards
PATCH 1/1 bpf: fix bpf_shim_tramp_link_release ifdef guards
They were updated in kernel/bpf/trampoline.c to fix another build issue. We should to do the same for include/linux/bpf.h header.
--- include/linux/bpf.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/linux/bpf.h +5 -1
@@ -1256,7 +1256,6 @@ int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr,#endif int bpf_trampoline_link_cgroup_shim (struct bpf_prog *prog,int cgroup_atype); -void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog);#else static inline const struct bpf_struct_ops *bpf_struct_ops_find (u32 type_id) {
@@ -1285,6 +1284,11 @@ static inline int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog, {return -EOPNOTSUPP ; } +#endif + +#if defined(CONFIG_CGROUP_BPF ) && defined(CONFIG_BPF_LSM ) +void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog); +#else static inline void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog) { }
Signature · 1 line
2.37.0.170.g444d1eabd0-goog
Quoted 15 lines · Stanislav Fomichev
They were updated in
kernel/bpf/trampoline.cto fix another build issue. We should to do the same forinclude/linux/bpf.hheader.Reported-by Stephen Rothwell <[email protected]>Fixes 3908fcddc65d ("bpf: fix lsm_cgroup build errors on esoteric configs")Signed-off-by Stanislav Fomichev <[email protected]>--- include/linux/bpf.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/linux/bpf.h +0
-0
include/linux/bpf.h int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr, · line 1258
Quoted 3 lines
include/linux/bpf.h +0
-0@@ -1256,7 +1256,6 @@ int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr,#endif int bpf_trampoline_link_cgroup_shim (struct bpf_prog *prog,int cgroup_atype);
This link_cgroup_shim also needs to move ?
Quoted 19 lines
include/linux/bpf.h +5
-1-void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog);#else static inline const struct bpf_struct_ops *bpf_struct_ops_find (u32 type_id) {@@ -1285,6 +1284,11 @@ static inline int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog, {return -EOPNOTSUPP ; } +#endif + +#if defined(CONFIG_CGROUP_BPF ) && defined(CONFIG_BPF_LSM ) +void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog); +#else static inline void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog) { }Signature · 1 line
2.37.0.170.g444d1eabd0-goog
Quoted 12 lines · Martin KaFai Lau
Quoted 10 lines · Stanislav Fomichev
They were updated in
kernel/bpf/trampoline.cto fix another build issue. We should to do the same forinclude/linux/bpf.hheader.Reported-by Stephen Rothwell <[email protected]>Fixes 3908fcddc65d ("bpf: fix lsm_cgroup build errors on esoteric configs")Signed-off-by Stanislav Fomichev <[email protected]>--- include/linux/bpf.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 9 lines
include/linux/bpf.h int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr, · line 1258
Quoted 8 lines
include/linux/bpf.h +0
-0@@ -1256,7 +1256,6 @@ int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr,#endif int bpf_trampoline_link_cgroup_shim (struct bpf_prog *prog,int cgroup_atype);This
link_cgroup_shimalso needs to move ?
Doh, definitely! Thanks for catching this.
Quoted 19 lines
Quoted 19 lines
include/linux/bpf.h +5
-2-void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog);#else static inline const struct bpf_struct_ops *bpf_struct_ops_find (u32 type_id) {@@ -1285,6 +1284,11 @@ static inline int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog, {return -EOPNOTSUPP ; } +#endif + +#if defined(CONFIG_CGROUP_BPF ) && defined(CONFIG_BPF_LSM ) +void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog); +#else static inline void bpf_trampoline_unlink_cgroup_shim (struct bpf_prog *prog) { } --2.37.0.170.g444d1eabd0-goog