[PATCH v2 1/5] lsm: Add hook unix_path_connect
Günther Noack
gnoack3000 at gmail.com
Thu Jan 15 22:32:21 UTC 2026
On Thu, Jan 15, 2026 at 04:24:48PM -0500, Demi Marie Obenour wrote:
> On 1/15/26 05:10, Günther Noack wrote:
> > I would prefer if the correctness of our LSM did not depend on
> > keeping track of the error scenarios in af_unix.c. This seems
> > brittle.
>
> Indeed so.
Thanks for the support!
> > Overall, I am not convinced that using pre-existing hooks is the right
> > way and I would prefer the approach where we have a more dedicated LSM
> > hook for the path lookup.
> >
> > Does that seem reasonable? Let me know what you think.
> >
> > –Günther
>
> Having a dedicated LSM hook for all path lookups is definitely my
> preferred approach. Could this allow limiting directory traversal
> as well?
No, this does not limit all path lookups, in the sense of what was
discussed in the thread at [1]. (I assume this is what you meant?)
The LSM hook proposed here is only about the lookup of named UNIX
domain sockets, as it happens when clients pass a struct sockaddr_un
to connect(2) or sendmsg(2).
–Günther
[1] https://lore.kernel.org/all/81f908e3-8a98-46e7-b20c-fe647784ceb4@gmail.com/
More information about the Linux-security-module-archive
mailing list