Re: [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 11, 2022 at 8:44 PM Daniel Borkmann <daniel@xxxxxxxxxxxxx> wrote:
>
> On 2/11/22 1:43 PM, Daniel Borkmann wrote:
> > On 2/11/22 1:11 PM, Yafang Shao wrote:
> >> A new member pin_name is added into struct bpf_prog_aux, which will be
> >> set when the prog is set and cleared when the pinned file is removed.
> >>
> >> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
> >> ---
> >>   include/linux/bpf.h      |  2 ++
> >>   include/uapi/linux/bpf.h |  1 +
> >>   kernel/bpf/inode.c       | 20 +++++++++++++++++++-
> >>   3 files changed, 22 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> >> index 0ceb25b..9cf8055 100644
> >> --- a/include/linux/bpf.h
> >> +++ b/include/linux/bpf.h
> >> @@ -933,6 +933,8 @@ struct bpf_prog_aux {
> >>           struct work_struct work;
> >>           struct rcu_head    rcu;
> >>       };
> >> +
> >> +    char pin_name[BPF_PIN_NAME_LEN];
> >>   };
> >
> > I'm afraid this is not possible. You are assuming a 1:1 relationship between prog
> > and pin location, but it's really a 1:n (prog can be pinned in multiple locations
> > and also across multiple mount instances). Also, you can create hard links of pins
> > which are not handled via bpf_obj_do_pin().
>
> (Same is also true for BPF maps wrt patch 2.)

Thanks again for the reminder.

-- 
Thanks
Yafang



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux