run: skip /dev/mqueue mount if not supported by the kernel#6941
Open
adenwuts wants to merge 1 commit into
Open
run: skip /dev/mqueue mount if not supported by the kernel#6941adenwuts wants to merge 1 commit into
adenwuts wants to merge 1 commit into
Conversation
On kernels built without CONFIG_POSIX_MQUEUE, mounting the default type=mqueue /dev/mqueue mount fails with ENODEV, breaking every buildah run and, through the vendored copy, every RUN instruction in podman build. Check /proc/filesystems for mqueue support and drop the /dev/mqueue mount when the filesystem is unavailable, mirroring the equivalent fix in podman's specgen (podman-container-tools/podman#28639). Signed-off-by: Aden Northcote <aden.northcote@whatbox.ca>
Luap99
reviewed
Jul 6, 2026
|
|
||
| // isMqueueSupported reports whether the kernel supports the mqueue | ||
| // filesystem, i.e. was built with CONFIG_POSIX_MQUEUE. | ||
| var isMqueueSupported = sync.OnceValue(func() bool { |
Member
There was a problem hiding this comment.
if this uses the same function as podman it should be moved to the common library, maybe as a new pkg there pkg/fsinfo or something like that?
So that then podman and buildah can reuse the same function from one place which means we also only have to cache it once.
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
On kernels built without
CONFIG_POSIX_MQUEUE, the defaulttype=mqueuemount for/dev/mqueue(seeded by runtime-tools'generate.New()) makes the runtime fail withENODEVon everybuildah run— and, through the copy vendored into podman, on everyRUNinstruction inpodman build.This ports the fix podman already has for
podman run/create(podman-container-tools/podman#28639) into buildah's spec generation: check/proc/filesystemsfor mqueue support, and drop the/dev/mqueuemount from the spec when the kernel doesn't provide the filesystem. When mqueue is unsupported the userns+host-IPC bind-mount replacement is skipped too, since the host has no/dev/mqueueto bind in that case.The
isMqueueSupportedimplementation mirrors podman's (sync.OnceValue, same parsing) so the two stay consistent.How to verify it
On a kernel without
CONFIG_POSIX_MQUEUE(nomqueueline in/proc/filesystems),buildah runpreviously failed withENODEVmounting/dev/mqueue; with this change the mount is dropped and the container starts. On normal kernels behavior is unchanged.The added unit test stubs
isMqueueSupportedand checks that the/dev/mqueuemount is present in the generated spec if and only if the kernel supports it.Which issue(s) this PR fixes:
None
Special notes for your reviewer:
The equivalent podman-side fix landed in podman-container-tools/podman#28639 (commits 1bda61b840 and d8df5c37ef); this change keeps buildah's behavior and implementation aligned with it.
Does this PR introduce a user-facing change?