On Tue, Mar 29, 2022 at 09:25:52AM -0700, Alexei Starovoitov wrote: > On Tue, Mar 29, 2022 at 9:17 AM Mathieu Desnoyers > <mathieu.desnoyers@xxxxxxxxxxxx> wrote: > > > > > > > >> include/uapi/linux/user_events.h: > > >> > > >> struct user_bpf_iter { > > >> > > >> /* Offset of the data within the first iovec */ > > >> __u32 iov_offset; > > >> > > >> /* Number of iovec structures */ > > >> __u32 nr_segs; > > >> > > >> /* Pointer to iovec structures */ > > >> const struct iovec *iov; > > >> > > >> ^ a pointer in a uapi header is usually a no-go. This should be a u64. > > >> }; > > >> > > >> include/uapi/linux/user_events.h: > > >> > > >> struct user_bpf_context { > > >> > > >> /* Data type being passed (see union below) */ > > >> __u32 data_type; > > >> > > >> /* Length of the data */ > > >> __u32 data_len; > > >> > > >> /* Pointer to data, varies by data type */ > > >> union { > > >> /* Kernel data (data_type == USER_BPF_DATA_KERNEL) */ > > >> void *kdata; > > >> > > >> /* User data (data_type == USER_BPF_DATA_USER) */ > > >> void *udata; > > >> > > >> /* Direct iovec (data_type == USER_BPF_DATA_ITER) */ > > >> struct user_bpf_iter *iter; > > >> > > >> ^ likewise for the 3 pointers above. Should be u64 in uapi headers. > > >> }; > > >> }; > > >> > > > > > > The bpf structs are only used within a BPF program. At that point the pointer > > > sizes should all align, right? > > > > I must admit I do not know enough about the eBPF uapi practices to answer this. > > [CCing Alexei on this] > > Mathieu, > > Thanks for flagging. > > Whoever added this user_bpf* stuff please remove it immediately. > It was never reviewed by bpf maintainers. > > It's a hard Nack to add a bpf interface to user_events. Sorry about that, I'm sending a patch to remove this. I'll have another patch to add it back in out to bpf and trace-devel for review. Thanks, -Beau