On Sat, 5 Dec 2026 at 01:29, Kuniyuki Iwashima <kuni…@google.com> wrote:
> > On Sat, 05 Dec 2026 01:15:00 +0000, Luca Boccassi wrote:
> > On Sat, 5 Dec 2026 at 01:07, Kuniyuki Iwashima <kuni…@google.com> wrote:
> > > > > > On Fri, 04 Dec 2026 16:34:05 +0000, luca…@gmail.com wrote:
> > > > Hi Kuniyuki, > > > > > > > > Is there any update on this series? It turns out it's something we really, really need in systemd as well...
> > > > > > Hmmm ... ?? > > > > > > I remember Christian and Lennart didn't want the filtering > > > capability with BPF and rather preferred just a socket option > > > for all or nothing. > > > > > > What has been changed then ? Any context ?
> > > > I wasn't part of those talks, but what happened is that AI tools > > figured out FUSE exists, and our security issue tracker is keeling > > over :-) > > So we really need to be able to install sender-side filters to stop > > certain types of FDs, like FUSE ones, from being sent in the first > > place...
> > What's the preferred API ? > > e.g. the app wants to preserve fd order, etc.
Given the typical way these protocols are constructed is that an index of each FD to identify it is passed in some custom format in the message buffer, which means it's unrealistic the filter could do something about it, I think the sensible way would be to preserve the order, and if the Nth FD is dropped, every (eventual) FD past it is dropped as well, and the FD counter is updated to reflect this? The in-band index is typically checked against the received FD count, so this should work out of the box. E.g. if 4 FDs are sent, and the filter drops the 2nd, the 3rd and 4th are dropped too, while the 1st one still goes through, and the message has a FD count of 1. I am not a kernel expert so I do not know whether this would be expressed in the bpf-lsm program, or in the kernel code itself. Christian/Lennart does this make sense?