Repository navigation
Conversation
Wire `fast_io::container::detect_rootless_container` (SQP-LAND.3) into `IoUringConfig::build_ring` so SQPOLL is declined before the doomed `io_uring_setup(IORING_SETUP_SQPOLL)` syscall is issued inside a rootless container. Inside a rootless Podman / Docker container, `CAP_SYS_NICE` is structurally unavailable. SQPOLL setup always returns `EPERM`, so the current behaviour wastes a guaranteed-failing syscall on every ring construction and only sets `SQPOLL_FALLBACK` after the kernel rejects the request. The detection signal lets us short-circuit cleanly, log a context-rich diagnostic citing the detector, and downgrade to a standard ring. The Linux backend now delegates the decision to a small pure helper `rootless_container_disables_sqpoll_inner` so unit tests can pump the detector outcome without root, mock filesystems, or actual containers. On non-Linux targets the gate is a constant `false` because SQPOLL is Linux-only. The fallback path is unchanged: still graceful (logged at the `Io` debug flag), still surfaced via `SQPOLL_FALLBACK` for `--version`, and still funnels into the existing standard-ring constructor. Audit: docs/audits/sqpoll-rootless-detection-status.md (SQP-LAND.1). Prereq helper: SQP-LAND.3.
Mirrors the SQP-LAND.3 base fix: is_identity_uid_map now treats an empty /proc/self/uid_map as no-signal and lets probe_with_reader fall through to the marker-file probes instead of falsely reporting a user namespace.
…ire-rootless-detection
…ire-rootless-detection
3 tasks done
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.
Summary
fast_io::container::detect_rootless_container(from SQP-LAND.3) intoIoUringConfig::build_ringso SQPOLL is declined before the doomedio_uring_setup(IORING_SETUP_SQPOLL)syscall is issued inside a rootless container.CAP_SYS_NICEis structurally unavailable. SQPOLL setup always returnsEPERM, so the current behaviour wastes a guaranteed-failing syscall on every ring construction and only setsSQPOLL_FALLBACKafter the kernel rejects the request. The detection signal lets us short-circuit cleanly, log a context-rich diagnostic citing the detector, and downgrade to a standard ring.rootless_container_disables_sqpoll_innerso unit tests can pump the detector outcome without root, mock filesystems, or actual containers. On non-Linux targets the gate is a constantfalse.Iodebug flag), still surfaced viaSQPOLL_FALLBACKfor--version, and still funnels into the existing standard-ring constructor.Important
Prereq. This PR is stacked on
feat/sqp-land-3-detect-rootless(PR #5554) becausecrate::container::detect_rootless_containerships there. Once #5554 lands on master, re-target this PR's base to master (GitHub auto-rebases the diff).Audit:
docs/audits/sqpoll-rootless-detection-status.md(SQP-LAND.1, PR #5548).Prereq helper: SQP-LAND.3 (PR #5554).
Test plan
true-> gate trips,SQPOLL_FALLBACKis set,sqpoll_requestedis neutralised.false-> gate does not trip, SQPOLL request reaches the builder,SQPOLL_FALLBACKstays clear.sqpoll_requested == false-> detector is never called (zero/proc/self/uid_mapprobes when there is nothing to disable).rootless_container_disables_sqpollwrapper and its inner helper are crate-private.build_ring.