Re: Why does GNU sed abuse /proc/filesystems? Re: [PATCH v3 0/3] revamp fs/filesystems.c

From: Mateusz Guzik

Date: Tue Apr 28 2026 - 04:43:10 EST


On Tue, Apr 28, 2026 at 08:36:00AM +0200, Cedric Blancher wrote:
> On Sun, 26 Apr 2026 at 00:09, Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
> >
> > The file is a mess with a hand-rolled linked list in a desperate need of
> > a clean up.
> >
> > The code to emit /proc/filesystems is used frequently because libselinux
> > reads the file, which in turn is linked into numerous frequently used
> > programs (even ones you would not suspect, like sed!). In order to
> > combat that pre-gen the string instead of pointer-chasing and printfing
> > one by-one.
>
> Why is GNU sed touching /proc/filesystems in the first place? This is
> not really a stable API, and would actually be a thing which should
> NOT be touched by a "simple" userland tool.
>
> <rant>maybe rename /proc/filesystems to
> /proc/filesystems_only_for_admin_purposes</rant>, or stick an ACL on
> it to prevent abuse?
>

It has support for file creation with the -i switch. For that reason it
links with libselinux which does the dirty on binary startup.