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.
7add29b79c
to2de7c2d07d
2de7c2d07d
toc809e9bd7c
c809e9bd7c
tod0d6f192ad
d0d6f192ad
to141bec290b
141bec290b
to9eb6bc71c4
9eb6bc71c4
toa5baad9e00
a5baad9e00
toc1ff73b1b1
Checkout
From your project repository, check out a new branch and test the changes.