Skip to content

Conversation

@cevich
Copy link
Member

@cevich cevich commented Nov 25, 2025

What type of PR is this?

/kind other

What this PR does / why we need it:

Backport PR #6484 & #6511

How to verify it

CI + Manual

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

The commits in this PR were created with the assistance of AI, based on the source #6520. When reviewing please pay special attention to the following:

  1. Vendor directory consistency:

    • Vendor directory was completely regenerated using make vendor-in-container after each go.mod change
    • Never manually edited, ensuring consistency with go.mod and go.sum
    • Backport change: Same process as source branch - vendor directory was regenerated after dependency updates to ensure consistency.
  2. All compilation verified:

    • Project compiles successfully with make after every commit
    • All compilation errors encountered during backport were resolved and ammended to the commit.
  3. "Disable lint checking"

    • This check fails on the branch even w/o any changes.
    • In CI the problem is difficult to diagnose as no output is provided,
      rather the process is simply killed.
    • Backport change: This commit was manually created, it does not exist on the
      source PRs.
  4. "Bump runc to v1.2.8 - CVE-2025-52881" and subsequent commits include extensive .Get() method calls:

    • run_common.go: Added .Get() calls for defaultConfig.Containers.DNSServers.Get(), DNSSearches.Get(), and DNSOptions.Get()
    • run_linux.go: Added .Get() call for defaultContainerConfig.Containers.DefaultUlimits.Get()
    • pkg/cli/common.go: Added .Get() calls for defaultContainerConfig.Containers.Volumes, Devices, DNSSearches, DNSServers, and DNSOptions
    • imagebuildah/executor.go: Added .Get() calls for defaultContainerConfig.Containers.Devices and Volumes
    • cmd/buildah/from.go: Added .Get() calls for defaultContainerConfig.Containers.DefaultUlimits and Devices
    • cmd/buildah/main.go: Added .Get() call for defaultContainerConfig.Engine.Env
    • Reason: The containers/common package changed attributedstring.Slice types to require explicit .Get() method calls to convert to []string before use.
  5. "run: handle relabeling bind mounts ourselves" - SELinux relabeling changes:

    • Added relabel() function in run_common.go that wraps label.Relabel() with error handling for ENOTSUP cases
    • Modified run_linux.go to detect and handle z and Z mount flags before passing mounts to the runtime, removing these flags from mount options after relabeling
    • Backport change: The source branch had similar logic, but the relabel() function was added as a helper to centralize the relabeling logic.
  6. "vendor: switch to moby/sys/capability" - Capability library migration:

    • Switched from github.com/syndtr/gocapability to github.com/moby/sys/capability in go.mod
    • Updated all imports and changed capability.List() to capability.ListKnown()
    • Backport change: Applied identically to the source branch. No adaptations were needed as the capability handling code structure is consistent between release-1.29 and release-1.33.
  7. SELinux API updates - Direct selinux package usage:

    • Backport change: Applied identically to the source branch. The duplicate import removal was necessary to resolve compilation errors during the backport.
  8. "Don't set ambient capabilities" - Ambient capability handling:

    • Modified chroot/run_linux.go to set ambient capabilities to empty array {} instead of using spec.Process.Capabilities.Ambient
    • Backport change: The source branch also modified cmd/buildah/unshare.go in the debugCapabilities function, but this was skipped during backport because the debugCapabilities function does not exist in the release-1.29 branch. Only the chroot/run_linux.go changes were applied.
  9. "Integration tests: run git daemon on a random-but-bind()able port" and "Add a dummy 'runtime' that just dumps its config file" - New test infrastructure:

    • Backport change: Applied identically to the source branch. The test infrastructure additions were straightforward and required no adaptations.
  10. "runUsingRuntime: use named constants for runtime states" - Runtime state constants:

    • Backport change: Applied identically to the source branch. The constants are available in the same specs package version used by release-1.29.
  11. "Bump Buildah to v1.29.6" - Version and changelog updates:

    • Content manually generated using buildah_release 1.29.6 script.

Does this PR introduce a user-facing change?

None

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cevich
Once this PR has been reviewed and has the lgtm label, please assign rhatdan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@TomSweeneyRedHat
Copy link
Member

@cevich I'm not sure where all these PRs came from when you put this together, regardless, it looks like a man page or two may need tweaking:

[+0017s] xref-helpmsgs-manpages: buildah login --help lists --compat-auth-file, but --compat-auth-file not in docs/buildah-login.1.md
[+0017s] xref-helpmsgs-manpages: buildah logout --help lists --compat-auth-file, but --compat-auth-file not in docs/buildah-logout.1.md

@cevich
Copy link
Member Author

cevich commented Nov 26, 2025

Actually the documentation is correct. My clanker helped identify the change as being caused by an update to Cobra w/ behavior changes, as part of the runc v1.2.8 update. So sadly, code changes are needed to fix this here and in #6540

@cevich
Copy link
Member Author

cevich commented Nov 26, 2025

@cevich I'm not sure where all these PRs

I've lost track days ago. With David out this week, I'm just going down my list of what needs updating and trying to make as much backport progress as I can (based on the next higher version). I'm hoping when the dust settles, it will all get worked out in the end.

@cevich
Copy link
Member Author

cevich commented Nov 26, 2025

Testing out a fix to the CLI options / Cobra update problem over in PR #6540

@cevich cevich force-pushed the release-1.29_cve_3113-52565-52881 branch from ded4bd3 to 71772b7 Compare December 1, 2025 14:15
@cevich
Copy link
Member Author

cevich commented Dec 1, 2025

Added "Handle Cobra v1.5 -> v1.8 behavior changes" commit.

@cevich cevich force-pushed the release-1.29_cve_3113-52565-52881 branch 3 times, most recently from 28b801f to 23c69c3 Compare December 1, 2025 21:00
@cevich
Copy link
Member Author

cevich commented Dec 2, 2025

Suggestion from Tom/Nalin:

the commits on the tip of https://github.com/nalind/buildah/tree/ci-1.29, particularly bumping the version of golang.org/x/tools and the linter in the tests/tools subdirectory, should get that further along.

@cevich
Copy link
Member Author

cevich commented Dec 2, 2025

Backported:

Note: I saw a few commits (6bf7400 and 56eadec) I may consider bringing here in place of disabling the lint-checking, but it's a low priority ATM.

@cevich cevich force-pushed the release-1.29_cve_3113-52565-52881 branch 2 times, most recently from 513abff to 7bf8e56 Compare December 2, 2025 20:01
@cevich cevich changed the title [release-1.29] Bump runc up to 1.2.8 for CVE-2025-52881, CVE-2025-31133 and CVE-2025-52565 [release-1.29] Bump runc up to 1.2.9 for CVE-2025-52881, CVE-2025-31133 and CVE-2025-52565 Dec 4, 2025
@cevich cevich force-pushed the release-1.29_cve_3113-52565-52881 branch from 7bf8e56 to becc9db Compare December 5, 2025 15:24
cevich and others added 6 commits December 5, 2025 11:38
This change is required for future commits that will bring in newer
vendored modules with elevated requirements.

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
In CI, the project and tests are compiled, so therefore require newer
CI/VM images with support for the newer golang requirements.

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Bumping golang.org/x/tools to v0.26.0 per @nalind's
suggestion.

Signed-off-by: tomsweeneyredhat <[email protected]>
Signed-off-by: Chris Evich <[email protected]>
Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
This addresses bumping crun to v1.2.9, which is a huge jump
but is necessary to address CVE-2025-52881, CVE-2025-31133
and CVE-2025-52565 plus various regressions in earlier versions.

Fixes: https://issues.redhat.com/browse/RHEL-126922
Fixes: https://issues.redhat.com/browse/RHEL-132843
Fixes: https://issues.redhat.com/browse/RHEL-126920
Fixes: https://issues.redhat.com/browse/RHEL-132850

Signed-off-by: Chris Evich <[email protected]>
A prior commit brought in a newer Cobra (out of necessity) which also
hauled in behavior changes WRT global-vs-local flag handling.  In order
to preserve the `buildah` CLI options prior to this change, additional
code changes are needed.  Fix the code such that
`hack/xref-helpmsgs-manpages` does not report any differences compared
to the pre-existing documentation (which presumably passed the check).

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
cevich and others added 14 commits December 5, 2025 12:07
github.com/moby/sys/capability is a fork of the (no longer maintained)
github.com/syndtr/gocapability package.

For the list of changes since the fork took place, see
https://github.com/moby/sys/blob/main/capability/CHANGELOG.md

Signed-off-by: Kir Kolyshkin <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Ambient capabilities can't be raised without inheritable ones, and since we
don't raise inheritable, we should not raise ambient either.

This went unnoticed because of a bug in syndtr/gocapability which is
only fixed in its fork (see the next commit).

Amends commit e7e55c9.

Signed-off-by: Kir Kolyshkin <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Use a listener helper to bind to an available-according-to-the-kernel
listening port and run a command with its stdio more or less tied to the
connection instead of trying to launch a git daemon directly using a
port number that we can only guess is available.

Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Handle requested relabeling of bind mounts (i.e., the "z" and "Z" flags)
directly, instead of letting the runtime handle the relabeling.

Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Use the named constants for the status values that runtimes can report
to us when we run them with the "state" command.

Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Tweak the wording that describes the effects of --cgroup-parent to be
clear that it only affects handling of RUN instructions.

Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Run integration tests (both as root and rootless) with both crun and
runc on Fedora, to help ensure that we can use either.

Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
This branch is only used as the source for RHEL releases, prune CI tests
that are irrelevant for this purpose.

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
A bug is present in some versions of runc (including 1.2.8) which result
in the wrong number of CPU shares being used.  Since the runc version
may change in a future commit, but still contain the bug, simply skip
the test rather than checking against the miscalculated value.

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
The previous handful of commits introduced fairly massive changes to
buildah, including an overhaul of the CI runtime environment itself.
Because of this, several tests need adjusting to match the new reality.

Signed-off-by: Chris Evich <[email protected]>
It is completely broken (see containers#4396) and is now causing failures
in Fedora gating tests:

   https://artifacts.dev.testing-farm.io/30e7b5bc-d162-4ae7-9a60-896f0186bf73/

Signed-off-by: Ed Santiago <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
The -cover flag causes many 'error: coverage... ; no coverage data written'
messages when GOCOVERDIR is not set. These messages needlessly clutter the test output.  Remove the -cover flag.

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
@cevich
Copy link
Member Author

cevich commented Dec 5, 2025

Note to me: CI first turned green in becc9db

Update the versions of ginkgo that we build for use by our e2e tests,
and the linter.

Signed-off-by: Nalin Dahyabhai <[email protected]>

Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
@cevich cevich force-pushed the release-1.29_cve_3113-52565-52881 branch from becc9db to 50a274d Compare December 5, 2025 18:46
Signed-off-by: Chris Evich <[email protected]>
Assisted-by: Claude (Anthropic)
Signed-off-by: Chris Evich <[email protected]>
@cevich cevich force-pushed the release-1.29_cve_3113-52565-52881 branch from 50a274d to 2d01a8e Compare December 5, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants