Re: [BUG] bpf, lsm: new first argument in 7.4 inode hooks silently breaks BPF LSMs

From: Paul Moore

Date: Mon Nov 23 2026 - 15:21:51 EST


On Mon, Nov 23, 2026 at 2:55 PM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
> On Thu, Nov 19, 2026 at 11:37 AM Paul Moore <paul@xxxxxxxxxxxxxx> wrote:
> >
> > On Thu, Nov 19, 2026 at 12:59 PM Andrii Nakryiko
> > <andrii.nakryiko@xxxxxxxxx> wrote:
> > > On Wed, Nov 18, 2026 at 7:14 AM Paul Mabileau
> > > <paul.mabileau@xxxxxxxxxxxxx> wrote:
> > > >
> > > > Hello,
> > > >
> > > > On our end, we also have already merged code to adapt our eBPFs to the argument order change. However, we would still prefer if this easily-avoidable breakage could be fixed by moving the argument to the end, even if it means having to revert our fix.
> > > >
> > > > This is motivated by the fact that such a change is not made in place on our end because we ship our software to environments we don't control, meaning that any and potentially all versions ranging from 4.11 to the very latest should be supported, so the change is made by compiling and shipping a new variant of the concerned eBPFs for the version interval it is valid for (7.4+ in this case). And that has to be done every time there is an upstream change like this, so the total installation size and overall complexity grows accordingly.
> > > >
> > > > If we could avoid that, especially for such trivial root causes, it would be nice.
> > > >
> > >
> > > I agree, and that's why I'm asking Paul to accept the patch reordering
> > > the newly added argument before 7.4 final is released.
> > >
> > > I do not think that the maintainer's personal preference for argument
> > > ordering beats real user pain.
> >
> > As stated several times in the past, the problem lies not with the LSM
> > framework but with the lack of an abstraction layer in the BPF LSM
> > providing a stable API. As far as I can tell the lack of an
>
> I think the problem lies neither in the LSM framework itself nor in
> the BPF LSM in particular. Neither have any abstractions built on top
> of LSM hook prototypes to guard against argument reshuffling. And
> that's fine and basically inevitable. If you change LSM hook
> prototype, you'd need to adjust source code of all LSM frameworks
> relying on that LSM hook (which is easy for in-tree source code, of
> course). For BPF LSM, if argument is added at the end, that pain can
> be avoided completely.

We're both repeating ourselves at this point, so I'll refer you back
to my previous comments about the LSM framework not being a stable
API. If there is an expectation of API stability or specific
extensibility in an individual LSM it is up to that LSM to provide
those guarantees, not the LSM framework. Considering the current
design of the BPF LSM, any breakage caused by this change with
existing BPF LSM programs is solely the BPF LSM's responsibility, as
far as I'm concerned.

> > abstraction layer in the BPF LSM is by design, and while that does
> > provide some advantages, one of the notable disadvantages is that the
> > API is unstable. If you want to be upset at anyone, direct your
> > frustrations towards the design and current implementation of the BPF
> > LSM.
>
> What upsets me is that your personal grudges against BPF community
> (or, perhaps, just particular members of it, doesn't matter) gets in
> the way of doing the right thing as a maintainer and putting Linux
> users' pain above your personal preferences and/or dislikes. And
> hiding this behind "I like this specific order of arguments" or "BPF
> LSM should have better architecture" is just petty.

What upsets me is your assumptions. Try to be better next time Andrii.

--
paul-moore.com