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
c1ff73b1b1
to22d577ab49
55d8c3bacb
toc9eeafbbf0
c9eeafbbf0
to2cf3077c07
2cf3077c07
toa6b2b9df22
a6b2b9df22
to1fa1ea5cbb
1fa1ea5cbb
to40028f3c03
40028f3c03
toff58de323a
ff58de323a
to75c260cd8d
75c260cd8d
to5db0714072
Merged.
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