Re: [PATCH] bpf: avoid padding in struct bpf_common_attr

From: Alexei Starovoitov

Date: Wed May 20 2026 - 10:03:44 EST


On Wed, May 20, 2026 at 8:39 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> On Wed, May 20, 2026, at 00:17, Yonghong Song wrote:
> > On 5/19/26 1:38 PM, Arnd Bergmann wrote:
> >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> >> index cc4c0b62cdfa..0f0ec00cae4a 100644
> >> --- a/include/uapi/linux/bpf.h
> >> +++ b/include/uapi/linux/bpf.h
> >> @@ -1507,6 +1507,7 @@ struct bpf_common_attr {
> >> __u32 log_size;
> >> __u32 log_level;
> >> __u32 log_true_size;
> >> + __u32 __pad;
> >
> > Let us make it as
> > __u32 :32;
> > ?
> > This can avoid people to use the '__pad' name.
>
> Sure. Do you want me to resend, are are you going to change
> it yourself?

No need to add a pad.
The issue was fixed in commit f05ddc6771c4 ("bpf: Check tail zero of
bpf_common_attr using offsetofend")

pw-bot: cr