container: optionally isolate host abstract UNIX domain sockets via landlock #1
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "netadr-landlock-lsm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request is made on behalf of @netadr.
Hi,
Attached is a patch from the v0.1.1 tag that adds optional isolation of host abstract UNIX domain sockets from the container via the Landlock LSM's LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET. I had to use libpsx to invoke landlock_restrict_self atomically across all threads due to Go's unpredictable thread model and the fact that Landlock applies rulesets on a per-thread basis. The patch introduces a corresponding NixOS option and matching documentation in addition the core functionality. The only notable omission is automated testing through the sandbox test tool -- I wasn't sure how the maintainers would want that to be set up. I would love if this could be upstreamed; please let me know if I can do anything further to assist :)
netadr (Clayton)
For landlock_restrict_self we might not need libpsx, since we can call runtime.LockOSThread() in [Container.Start] somewhere before landlock_restrict_self is called. I have yet to verify this for landlock_restrict_self but it works for all other syscalls that works on the calling thread.
7add29b79cto2de7c2d07d2de7c2d07dtoc809e9bd7cc809e9bd7ctod0d6f192add0d6f192adto141bec290b141bec290bto9eb6bc71c49eb6bc71c4toa5baad9e00a5baad9e00toc1ff73b1b1c1ff73b1b1to22d577ab4955d8c3bacbtoc9eeafbbf0c9eeafbbf0to2cf3077c072cf3077c07toa6b2b9df22a6b2b9df22to1fa1ea5cbb1fa1ea5cbbto40028f3c0340028f3c03toff58de323aff58de323ato75c260cd8d75c260cd8dto5db0714072Merged.
xref
5db0714072.Hey, I just today saw the response to my initial patch! Thank you for cleaning it up and merging it (and thank you @maemachinebroke for forwarding the response) 🙂
Pull request closed