@@ -1294,6 +1294,12 @@ bool __bpf_dynptr_is_rdonly(const struct bpf_dynptr_kern *ptr);
12941294#ifdef CONFIG_BPF_JIT
12951295int bpf_trampoline_link_prog (struct bpf_tramp_link * link , struct bpf_trampoline * tr );
12961296int bpf_trampoline_unlink_prog (struct bpf_tramp_link * link , struct bpf_trampoline * tr );
1297+ int bpf_extension_link_prog (struct bpf_tramp_link * link ,
1298+ struct bpf_trampoline * tr ,
1299+ struct bpf_prog * tgt_prog );
1300+ int bpf_extension_unlink_prog (struct bpf_tramp_link * link ,
1301+ struct bpf_trampoline * tr ,
1302+ struct bpf_prog * tgt_prog );
12971303struct bpf_trampoline * bpf_trampoline_get (u64 key ,
12981304 struct bpf_attach_target_info * tgt_info );
12991305void bpf_trampoline_put (struct bpf_trampoline * tr );
@@ -1383,6 +1389,18 @@ static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
13831389{
13841390 return - ENOTSUPP ;
13851391}
1392+ static inline int bpf_extension_link_prog (struct bpf_tramp_link * link ,
1393+ struct bpf_trampoline * tr ,
1394+ struct bpf_prog * tgt_prog )
1395+ {
1396+ return - ENOTSUPP ;
1397+ }
1398+ static inline int bpf_extension_unlink_prog (struct bpf_tramp_link * link ,
1399+ struct bpf_trampoline * tr ,
1400+ struct bpf_prog * tgt_prog )
1401+ {
1402+ return - ENOTSUPP ;
1403+ }
13861404static inline struct bpf_trampoline * bpf_trampoline_get (u64 key ,
13871405 struct bpf_attach_target_info * tgt_info )
13881406{
@@ -1483,6 +1501,9 @@ struct bpf_prog_aux {
14831501 bool xdp_has_frags ;
14841502 bool exception_cb ;
14851503 bool exception_boundary ;
1504+ bool is_extended ; /* true if extended by freplace program */
1505+ u64 prog_array_member_cnt ; /* counts how many times as member of prog_array */
1506+ struct mutex ext_mutex ; /* mutex for is_extended and prog_array_member_cnt */
14861507 struct bpf_arena * arena ;
14871508 /* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
14881509 const struct btf_type * attach_func_proto ;
0 commit comments