RE: [RFC][PATCH v3 02/15] bpf: Set open_flags as last bpf_attr field for bpf_*_get_fd_by_id() funcs

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

 



> 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



[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