Repository navigation
1.1.70: the bug hunt's HIGH findings and three more regressions - #263
Merged
Merged
Conversation
Folded into 1.1.70 (not tagged yet), on top of #262: - Host descriptors no longer reach jails: SOCK_CLOEXEC on the cached IfconfigOps socket; closefrom(3) in the children of the Util exec helpers, JailExec and the ws-console shell; the crated-spawned supervisor keeps only stdio and its status pipe. - devfs: a per-user caller may fill only a private ruleset (10000..59999) that no live jail of another caller uses; crated records every apply_devfs_rules; add_devfs_unhide_rule is refused to tenants; crate run steps to the next number on a refusal. - backup-prune applies retention per jail; 128-char jail names parse. - HTTP export: tar --one-file-system, paths from pathnames.h. - JailQuery::findContainer: targets by kernel name, jid or container name (RunPure::containerNameOf / containerNameOfJail); restart in the CLI, the control socket and HTTP decides what to start before it stops; start no longer spawns a second instance. - A tmpfs over /tmp is mounted before the X11 setup (firefox/chromium). - crate -p stack up: --log-progress before `run` (StatusPure::crateRunArgv). - One terminal event per --status-fd stream; jail_created carries the kernel's jail name. Docs: crate.5, trust-model en/uk, README en/uk, runbook §4m, CHANGELOG, TODO (what this left open). make test-unit -Werror: 1602/1602. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6t6tzVypHye5bDGLxzmZK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.1.70 (continued) — HIGH findings + regressions of 1.1.65–1.1.67
Still version 1.1.70 (not tagged yet): this extends the
[1.1.70]CHANGELOG section that #262 opened, no version bump.Host descriptors leaked into jails (
lib/ifconfig_ops.cpp,lib/util.cpp,lib/jail_query.cpp,daemon/ws_console.cpp,lib/status_fd.cpp)The cached
IfconfigOpsioctl socket (UDP, host stack, alive for the life of crated /crate run) had no close-on-exec, and the exec helpers passed every descriptor on. Jexec'ed/etc/rc, ifconfig, ws-console shells andjail_attached commands inherited it. Fixes:SOCK_CLOEXECon the socket.closefrom(3)in the children ofUtil::execCommand*/execPipeline,JailExec::execInJail*/spawnInJailand the ws-console shell.devfs rulesets (
lib/privops_authz_pure,daemon/privops_handlers.cpp,lib/run.cpp,lib/devices_pure)apply_devfs_rulesdeletes and refills the ruleset it names, and the gate looked only atmount_path. A tenant could therefore rewrite ruleset 4 or another tenant's private set. Now:DenyForeignDevfsRuleset).apply_devfs_rulesover libnv, root included. A record lasts while that devfs is mounted.add_devfs_unhide_rule(which writes into whatever set the mount uses) is refused to tenants (DenyDevfsSharedRuleset).crate runsteps to the next number on a refusal.backup-prune(lib/backup_prune_pure)--jail,daily=1kept one jail's newest stream and deleted the other jails' fulls. They now apply per jail, and an incremental's base must come from the same jail.HTTP export (
daemon/routes.cpp)tar --one-file-system, as the CLI export has had since 1.1.48. Shares, the X11 dir, a read-only base, devfs and tmpfs stay out of the archive. Paths come frompathnames.h.Container name vs kernel name (
lib/jail_query,lib/run_pure,lib/lifecycle.cpp,daemon/control_socket.cpp,daemon/routes.cpp, CLI targets)The kernel name is
web_pid4242(privops) or the jid (root path). The registry and/var/run/crate/<name>.crateuseweb. Before this change:crate restartstopped the container and then found nothing to start.Now:
JailQuery::findContainerresolves a kernel name, a jid or a container name.RunPure::containerNameOfJailreads the name off the jail directory for root-path jails. An ambiguous name gets 409.stopCrate.tmpfs: [/tmp]hid the X11 socket (lib/run.cpp,lib/mounts_pure,lib/validate_pure.cpp)A tmpfs at or above
/tmp/.X11-unix//tmp/waylandis now mounted before the X11 setup, which fixes the firefox and chromium profiles.crate validateno longer warns that it hides shares under it.Third-review regressions
crate -p stack upplaced--log-progressafterrun, so no member started. Fixed withStatusPure::crateRunArgv.exited+failed. The stream now carries exactly one terminal event.jail_createdreported a name no jail had on the root path. It now reports the kernel's name.Docs / tests
--nameunder jail(8).make test-unitwith-Werror: 1602/1602 passed (+10 cases).make check-versionandmake check-kyuafilepass. mandoc lint shows only pre-existing warnings.Generated by Claude Code