> From: Alexei Starovoitov [mailto:alexei.starovoitov@xxxxxxxxx] > Sent: Friday, July 22, 2022 7:55 PM > On Fri, Jul 22, 2022 at 07:18:23PM +0200, Roberto Sassu wrote: > > The bpf() system call validates the bpf_attr structure received as > > argument, and considers data until the last field, defined for each > > operation. The remaing space must be filled with zeros. > > > > Currently, for bpf_*_get_fd_by_id() functions except bpf_map_get_fd_by_id() > > the last field is *_id. Setting open_flags to BPF_F_RDONLY from user space > > will result in bpf() rejecting the argument. > > The kernel is doing the right thing. It should not ignore fields. Exactly. As Andrii requested to add opts to all bpf_*_get_fd_by_id() functions, the last field in the kernel needs to be updated accordingly. Roberto