Re: [BUG] bpf, lsm: new first argument in 7.4 inode hooks silently breaks BPF LSMs
From: Andrii Nakryiko
Date: Tue Nov 17 2026 - 11:52:06 EST
On Thu, Nov 12, 2026 at 6:41 PM Paul Moore <paul@xxxxxxxxxxxxxx> wrote:
>
> On Thu, Nov 12, 2026 at 6:00 PM Andrii Nakryiko
> <andrii.nakryiko@xxxxxxxxx> wrote:
> > On Mon, Nov 9, 2026 at 7:08 AM roblabla <linux@xxxxxxxxx> wrote:
> > >
> > > Hi,
> > >
> > > Thanks for the replies!
> > >
> > > > LSMs that need to provide a stable API must provide an abstraction
> > > > layer between the LSM hook callbacks and their stable API. The LSM
> > > > framework is not responsible for the stability of individual LSM APIs.
> > >
> > > Understood, that lines up with my expectations. I think the biggest
> > > thing here would not necessarily be stability guarantees, but rather to
> > > make sure that the eBPFs fail to load when the compatibility is broken.
> > > But that's probably a problem for the eBPF side, and not LSM, I assume.
> > >
> > > > So, in short, would it be possible to send a follow up to Daan's
> > > > commit and move `struct mnt_idmap *idmap` to the end of LSM argument
> > > > list?
> > >
> > > If this is possible, that'd be nice so that we avoid this breakage in
> > > the short term, since the change isn't in a released kernel yet.
> >
> > can you please send a patch proposing that and we can continue
> > discussion there? please cc me so I can follow along
>
> Considering the original patch was submitted, reviewed, and merged
> with the BPF LSM being the only user (none of the existing in-tree
> LSMs use the idmap parameter at present), I'm a little surprised this
> wasn't brought up earlier.
Yeah, unfortunately this was missed. Not sure it's surprising that it
wasn't detected immediately, though, because unlikely someone tested
an unreleased kernel in production. Luckily, this was still detected
early enough before the final release and this gives us a chance to
fix a mistake.
>
> Beyond that, from a style perspective, I think I prefer the idmap at
> the front of the parameter list in most (all?) of the hooks where it
> was added. I'm not interested in moving it at this point in time.
So on one hand we have a real user pain which is easily fixable
without burdening kernel and LSM subsystem in particular, right? On
the other hand there is a minor issue of argument ordering with
mnt_idmap preferably as a first argument. I get the preference, but I
think fixing an unnecessary (but easily fixable!) user pain should
come first, don't you agree?
Can you please reconsider?
>
> --
> paul-moore.com