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

From: Geert Uytterhoeven

Date: Wed May 20 2026 - 10:25:19 EST


Hi Alexei,

On Wed, 20 May 2026 at 16:03, Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
> 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")

I am afraid that commit does not fix any -Wpadded warnings?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds