c6397b941f
container/initproc: check path equivalence by value
...
Fixes regression introduced while integrating Absolute.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 19:29:45 +09:00
d65e5f817a
container/initplace: check path equivalence by value
...
Fixes regression introduced while integrating Absolute.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 19:19:27 +09:00
696e593898
container/initoverlay: check path equivalence by value
...
Fixes regression introduced while integrating Absolute.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 17:33:15 +09:00
97ab24feef
container/init: use absolute compare method
...
More checks are also added.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 17:14:36 +09:00
31f0dd36df
absolute: efficient equivalence check method
...
This is more efficient and makes the call site cleaner.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 17:06:38 +09:00
9aec2f46fe
container/initdev: check path equivalence by value
...
Fixes regression introduced while integrating Absolute.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 02:55:45 +09:00
022cc26b2e
container/capability: check CAP_TO_INDEX and CAP_TO_MASK
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 02:45:00 +09:00
b4c018da8f
container/autoetc: do not bypass absolute check
...
This can now be done cleanly via path function wrappers.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 02:37:11 +09:00
66f52407d3
container/initmkdir: check path equivalence by value
...
Fixes regression introduced while integrating Absolute.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 02:32:22 +09:00
e463faf649
container/initbind: check path equivalence by value
...
Same problem as autoroot, never updated the checks after integrating Absolute.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 02:22:04 +09:00
375acb476d
container/autoroot: check host path equivalence by value
...
This will never return true otherwise unless the equivalent paths happen to be interned by the caller.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 02:14:39 +09:00
c81c9a9d75
container/init: split setup ops into individual files
...
This significantly increases readability.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 01:28:31 +09:00
339e4080dc
container/ops: move Op type to init file
...
This helps with the eventual separation of all setup ops into individual files.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 01:11:24 +09:00
e0533aaa68
container/autoroot: filter dentry with empty name
...
This is unreachable, but nice to have just in case.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 01:03:49 +09:00
13c7083bc0
container: ptrace protection via Yama LSM
...
This is only a nice to have feature as the init process has no additional privileges and the monitor process was never reachable anyway.
Closes #4 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-20 00:43:55 +09:00
6947ff04e0
system/dbus/proc: host abstract only when not binding
...
The test failure seems to be caused by an unrelated bug in xdg-dbus-proxy.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-19 23:39:14 +09:00
140fe21237
container/params: check setup/receive behaviour
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 22:30:34 +09:00
f52d2c7db6
container/path: check create and mountinfo helpers
...
These can quite easily be checked within the framework. The scanner fault injection might require updating at some point if the implementation changes.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 21:30:28 +09:00
3c9e547c4a
cmd/hpkg: add deprecation notice
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 17:00:27 +09:00
a3988c1a77
hst: rename net and abstract fields
...
This makes more sense and matches the container library.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 16:48:01 +09:00
5db0714072
container: optionally isolate host abstract UNIX domain sockets via landlock
2025-08-18 16:28:14 +09:00
69a4ab8105
container: move PR_SET_NO_NEW_PRIVS to parent
...
This allows some LSM setup in the parent.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 11:46:02 +09:00
22d577ab49
test/sandbox: do not discard stderr getting hash
...
This is the first hakurei run in the test, if the container outright fails to start this is often where it happens, so throwing away the output is very unhelpful.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 11:36:13 +09:00
83a1c75f1a
app: set up acl on X11 socket
...
The socket is typically owned by the priv-user, and inaccessible by the target user, so just allowing access to the directory is not enough. This change fixes this oversight and add checks that will also be useful for merging security/hakurei#1 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-18 11:30:58 +09:00
0ac6e99818
container: start from locked thread
...
This allows setup that relies on per-thread state like securebits and landlock, from the parent side.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-17 17:42:22 +09:00
f35733810e
container: check output helper functions
...
The container test suite has always been somewhat inadequate due to the inability of coverage tooling to reach into containers. This has become an excuse for not testing non-container code as well, which lead to the general lack of confidence when working with container code. This change aims to be one of many to address that to some extent.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-17 02:59:37 +09:00
9c1a5d43ba
container: enforce nonrepeatable autoetc and autoroot
...
These keep track of some internal state, and they don't make sense to have multiple instances of anyway, so instead of dealing with that, just make them nonrepetable.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-17 01:43:11 +09:00
8aa65f28c6
container: allow additional state between ops
...
This is useful for ops that need to be aware of previous instances of themselves.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-17 01:32:07 +09:00
f9edec7e41
hst: merge miscellaneous files
...
These structs were going to be bigger at some point. They turned out not to be.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-16 02:32:57 +09:00
305c600cf5
hst: move container type to config
...
Container state initialisation is no longer implemented in hst so splitting them no longer makes sense.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-16 02:28:36 +09:00
8dd3e1ee5d
hst/fs: rename method Target to Path
...
This allows adapter structs to use the same field names as Op structs.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-16 02:06:41 +09:00
4ffeec3004
hst/enablement: editor friendly enablement adaptor
...
Having the bit field value here (in decimal, no less) is unfriendly to text editors. Use a bunch of booleans here to improve ease of use.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-15 05:16:51 +09:00
9ed3ba85ea
hst/fs: implement overlay fstype
...
This finally exposes overlay mounts in the high level hakurei API.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-15 04:00:55 +09:00
4433c993fa
nix: check config via hakurei
...
This is unfortunately the only feasible way of doing this in nix.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-15 03:27:54 +09:00
430991c39b
hst/fs: remove type method
...
Having a method that returns the canonical string representation of its type seemed like a much better idea for an implementation that never made it to staging. Remove it here and clean up marshal type assertions.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-15 00:39:02 +09:00
ba3227bf15
container: export overlay escape
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-14 23:44:11 +09:00
0e543a58b3
hst/fs: valid method on underlying interface
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-14 21:36:22 +09:00
c989e7785a
hst/info: include extra information
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-14 19:52:03 +09:00
332d90d6c7
container/path: remove unused path
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-14 05:00:09 +09:00
99ac96511b
hst/fs: interface filesystem config
...
This allows mount points to be represented by different underlying structs.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-14 04:52:49 +09:00
e99d7affb0
container: use absolute for pathname
...
This is simultaneously more efficient and less error-prone. This change caused minor API changes in multiple other packages.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-11 04:56:42 +09:00
41ac2be965
container/absolute: wrap safe stdlib functions
...
These functions do not change the absoluteness of a pathname.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-10 03:11:10 +09:00
02271583fb
container: remove PATH lookup behaviour
...
This is way higher level than the container package and does not even work unless every path is mounted in the exact same location.
This behaviour causes nothing but confusion and problems,
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-09 19:08:54 +09:00
ef54b2cd08
container/absolute: early absolute pathname check
...
This is less error-prone, and allows pathname to be checked once.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-09 18:53:46 +09:00
82608164f6
container/params: remove confusingly named error
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-09 17:37:46 +09:00
edd6f2cfa9
container: document ambient capabilities
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-08 02:11:55 +09:00
acffa76812
container/ops: implement overlay op
...
There are significant limitations to using the overlay mount, and the implementation in the kernel is quite quirky. For now the Op is quite robust, however a higher level interface for it has not been decided yet.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-08 01:54:48 +09:00
8da76483e6
container/path: fix typo "paths"
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-08 01:32:48 +09:00
534c932906
container: test case runtime initialisation
...
This allows for more sophisticated test setup.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-08 01:03:35 +09:00
fee10fed4d
container: test bypass output buffer on verbose
...
This restores verbose behaviour.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-08-08 00:57:27 +09:00