aboutsummaryrefslogtreecommitdiffhomepage
path: root/container
AgeCommit message (Collapse)Author
2025-08-26container/initdev: mount tmpfs on shm for ro devOphestra
Programs expect /dev/shm to be a writable tmpfs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-26container/initbind: optional ensure host directoryOphestra
This is used for ensuring persistent data directories specific to the container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-25container/dispatcher: remove exit stub test logOphestra
Turns out testing.T does not like being called in defer. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-25container/autoroot: remove prefix fieldOphestra
This field has been a noop for a long time. Remove it to prevent further confusion. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-25container/initoverlay: internal bypass sysroot prefixOphestra
This is for supporting overlay mounts for autoroot. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-24container/init: measure init behaviourOphestra
This used to be entirely done via integration tests, with almost no hope of error injection and coverage profile. These tests significantly increase confidence of future work in this area. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/dispatcher: start goroutine in dispatcherOphestra
This allows instrumentation of calls from goroutine without relying on finalizers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/init: avoid multiple lastcap callsOphestra
This reduces the size of []kexpect in the test suite. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/dispatcher: instrument each goroutine individuallyOphestra
Scheduler nondeterminism cannot be accounted for, so do this instead. There should not be any performance penalty as these calls are optimised out for direct. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/params: pass fd instead of fileOphestra
The file is very difficult to stub. Pass fd instead as it is the value that is actually useful. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container/init: call lockOSThread through dispatcherOphestra
This degrades test performance if not stubbed out. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container: move integration test helpersOphestra
With the new instrumentation it is now possible to run init code outside integration tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container/path: use syscall dispatcherOphestra
This allows path and mount functions to be instrumented. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container/init: wrap syscall helper functionsOphestra
This allows tests to stub all kernel behaviour, enabling measurement of all function call arguments and error injection. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-21container/syscall: doc comments from manpagesOphestra
These are pulled straight from the manpages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-21container/init: op interface valid methodOphestra
Check ops early and eliminate duplicate checks. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/inittmpfs: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initsymlink: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initremount: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initproc: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initplace: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initoverlay: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/init: use absolute compare methodOphestra
More checks are also added. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20absolute: efficient equivalence check methodOphestra
This is more efficient and makes the call site cleaner. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initdev: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/capability: check CAP_TO_INDEX and CAP_TO_MASKOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/autoetc: do not bypass absolute checkOphestra
This can now be done cleanly via path function wrappers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initmkdir: check path equivalence by valueOphestra
Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/initbind: check path equivalence by valueOphestra
Same problem as autoroot, never updated the checks after integrating Absolute. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/autoroot: check host path equivalence by valueOphestra
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-20container/init: split setup ops into individual filesOphestra
This significantly increases readability. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/ops: move Op type to init fileOphestra
This helps with the eventual separation of all setup ops into individual files. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container/autoroot: filter dentry with empty nameOphestra
This is unreachable, but nice to have just in case. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-20container: ptrace protection via Yama LSMOphestra
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-18container/params: check setup/receive behaviourOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-18container/path: check create and mountinfo helpersOphestra
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-18container: optionally isolate host abstract UNIX domain sockets via landlockClayton Gilmer
2025-08-18container: move PR_SET_NO_NEW_PRIVS to parentOphestra
This allows some LSM setup in the parent. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-17container: start from locked threadOphestra
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-17container: check output helper functionsOphestra
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-17container: enforce nonrepeatable autoetc and autorootOphestra
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-17container: allow additional state between opsOphestra
This is useful for ops that need to be aware of previous instances of themselves. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-14container: export overlay escapeOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-14container/path: remove unused pathOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-11container: use absolute for pathnameOphestra
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-10container/absolute: wrap safe stdlib functionsOphestra
These functions do not change the absoluteness of a pathname. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-09container: remove PATH lookup behaviourOphestra
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-09container/absolute: early absolute pathname checkOphestra
This is less error-prone, and allows pathname to be checked once. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-09container/params: remove confusingly named errorOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-08container: document ambient capabilitiesOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>