Commit Graph

5728 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] 7de7f22041
Merge pull request #6222 from openshift-cherrypick-robot/cherry-pick-6221-to-release-1.37
[release-1.37] Builder.sbomScan(): don't break non-root scanners
2025-06-11 19:12:04 +00:00
Nalin Dahyabhai 6c0dab1d6e Builder.sbomScan(): don't break non-root scanners
Set up permissions on the scanner output directory so that scanners
whose images specify that they be run as non-root users can still write
to it.  The most recent syft image exposed our bug.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-11 16:49:21 +00:00
openshift-merge-bot[bot] 59efd7b935
Merge pull request #6024 from TomSweeneyRedHat/dev/tsweeney/conftest-release-1.37
[release-1.37] tests/conformance/testdata/Dockerfile.add:...
2025-03-04 22:55:04 +00:00
Nalin Dahyabhai 2727cf7d2c [release-1.37] tests/conformance/testdata/Dockerfile.add:...
update some URLs

The origin repository renamed its "master" branch to "main", so we need
to update our references to items in that branch.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-03-04 15:26:59 -05:00
openshift-merge-bot[bot] fd39521492
Merge pull request #5919 from nalind/v1.37.6
[release-1.37] tag v1.37.6
2025-01-22 18:03:53 +00:00
Nalin Dahyabhai 75ef41ea3a Tag v1.37.6
Tag a new release to incorporate the recent security advisory, and make
a minor update to the CI configuration.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-20 13:12:00 -05:00
Nalin Dahyabhai 419d6fb9b3
Merge commit from fork
[release-1.37] fix TOCTOU error when bind and cache mounts use "src" values
2025-01-20 13:00:23 -05:00
Nalin Dahyabhai 31db4f8d06 Fix TOCTOU error when bind and cache mounts use "src" values
Fix a time-of-check/time-of-use error when mounting type=bind and
type=cache directories that use a "src" flag.  A hostile writer could
use a concurrently-running stage or build to replace that "src" location
between the point when we had resolved possible symbolic links and when
runc/crun/whatever actually went to create the bind mount
(CVE-2024-11218).

Stop ignoring the "src" option for cache mounts when there's no "from"
option.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 14:33:43 -05:00
Nalin Dahyabhai b41133dad7 define.TempDirForURL(): always use an intermediate subdirectory
Ensure that the temporary directory that we create is never itself the
top-level directory of the content that we're downloading, in case it's
an archive which includes a "." with weird permissions.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 14:33:43 -05:00
Nalin Dahyabhai 2c7003508a internal/volume.GetBindMount(): discard writes in bind mounts
When handling RUN --mount=type=bind, where the mount is read-write,
instead of a simple bind mount, create an overlay mount with an upper
directory that will be discarded after the overlay mount is unmounted.
This brings us in line with the expected behavior, wherein writes to
bind mounts should be discarded.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 14:33:41 -05:00
Nalin Dahyabhai 1952dd52c5 pkg/overlay: add a MountLabel flag to Options
Add a way to pass a "set the SELinux contexts" labels to
MountWithOptions.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 13:31:10 -05:00
Nalin Dahyabhai d5ed9ce388 pkg/overlay: add a ForceMount flag to Options
Add a ForceMount flag to pkg/overlay.Options that forces mounting the
overlay filesystem and returning a bind mount to it instead of trying to
leave that for later in cases where we're able to have the kernel do it.

This is mainly for the sake of callers that want to do more things with
the mounted overlay filesystem before passing them to the (presumably)
OCI runtime.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 13:31:10 -05:00
Nalin Dahyabhai 5ea0b74b9d Add internal/volumes.bindFromChroot()
Add a helper that uses the new internal/open package to bind mount a
location inside of a chroot direct to a new temporary location, for
ensuring that the latter is not bind-mounted from outside of the chroot.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 13:31:10 -05:00
Nalin Dahyabhai d95e672660 Add an internal/open package
Add a package that lets us open a directory in a chroot, pass its
descriptor up, and then bind mount that directory to a specified
location.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 13:31:10 -05:00
Nalin Dahyabhai 8c7c9da3f2 Allow cache mounts to be stages or additional build contexts
Allow cache mounts (RUN --mount=type=cache) to refer to other stages or
additional build contexts.

Update the build-check-cve-2024-9675 integration test to use different
directories for its main build context and the additional build context
that it uses for its final run.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-01-17 13:30:35 -05:00
openshift-merge-bot[bot] 55ee4ec6f9
Merge pull request #5910 from TomSweeneyRedHat/dev/tsweeney/change1.37
[release-1.37][CI:DOCS] Touch up changelogs
2025-01-16 17:58:48 +00:00
tomsweeneyredhat a99025d5cc [release-1.37][CI:DOCS] Touch up changelogs
The changelog.txt and CHANGELOG.md files each had "vv1.37" instead of "v1.37". This corrects that.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-01-15 17:25:39 -05:00
openshift-merge-bot[bot] c0602013ad
Merge pull request #5793 from TomSweeneyRedHat/dev/tsweeney/change_v1.37
[release-1.37][CI:DOCS] touchup changelog
2024-10-22 11:04:17 +00:00
tomsweeneyredhat e4deb56f62 [release-1.37][CI:DOCS] touchup changelog
This updates the changelog.txt in the release-1.37 branch to include
CVE numbers that were fixed with a couple of commits.  I was able to
update CHANGELOG.MD in a separate commit.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-10-18 10:46:23 -04:00
Tom Sweeney f31d99d24e
Update CHANGELOG.md
Add CVE's to the pertinent changlog entries.

Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
2024-10-18 10:38:20 -04:00
openshift-merge-bot[bot] 86250fac88
Merge pull request #5789 from TomSweeneyRedHat/dev/tsweeney/dev/tsweeney/v1.37.5
[release-1.37] Bump Buildah to v1.37.5
2024-10-18 10:22:50 +00:00
tomsweeneyredhat 5fd40b9898 [release-1.37] Bump Buildah to v1.37.5
Bump to v1.37.5 to incoroprate the fixes needed for CVE-2024-3675

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-10-17 19:50:11 -04:00
openshift-merge-bot[bot] 82eb1c44fe
Merge pull request #5786 from mheon/vendor_cs_1551
[release-1.37] Bump the containers/storage library to v1.55.1
2024-10-17 21:49:12 +00:00
Matt Heon b949f6572c Bump the containers/storage library to v1.55.1
Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-17 14:40:07 -04:00
openshift-merge-bot[bot] 1c85198376
Merge pull request #5780 from openshift-cherrypick-robot/cherry-pick-5778-to-release-1.37
[release-1.37] Properly validate cache IDs and sources
2024-10-17 11:11:51 +00:00
Matt Heon cffa820dc8 Properly validate cache IDs and sources
The `--mount type=cache` argument to the `RUN` instruction in
Dockerfiles was using `filepath.Join` on user input, allowing
crafted paths to be used to gain access to paths on the host,
when the command should normally be limited only to Buildah;s own
cache and context directories. Switch to `filepath.SecureJoin` to
resolve the issue.

Fixes CVE-2024-9675

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-10 19:36:17 +00:00
openshift-merge-bot[bot] d722aa97e4
Merge pull request #5775 from openshift-cherrypick-robot/cherry-pick-5774-to-release-1.37
[release-1.37] [skip-ci] Packit: constrain koji job to fedora package to avoid dupes
2024-10-08 12:04:37 +00:00
Lokesh Mandvekar 93986b888c Packit: constrain koji job to fedora package to avoid dupes
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2024-10-08 11:13:05 +00:00
openshift-merge-bot[bot] df9247c59b
Merge pull request #5768 from nalind/release-v1.37.4
[release-1.37] tag v1.37.4
2024-10-06 10:32:47 +00:00
Nalin Dahyabhai 9dfacbb47e Tag v1.37.4
Bump version identifiers to v1.37.4.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-10-04 10:14:15 -04:00
openshift-merge-bot[bot] e4e2ad5ca2
Merge pull request #5764 from Luap99/release-1.37
[release-1.37] Fix CVE-2024-9407 and CVE-2024-9341
2024-10-02 13:28:41 +00:00
Paul Holzinger b55cbb8eb7
vendor: update c/common to v0.60.4
Update c/common to fix CVE-2024-9341

Fixes CVE-2024-9341
Fixes https://issues.redhat.com/browse/RHEL-61114
Fixes https://issues.redhat.com/browse/RHEL-61112

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-02 11:00:41 +02:00
Nalin Dahyabhai e289e285dc
CVE-2024-9407: validate "bind-propagation" flag settings
CVE-2024-9407: validate that the value for the "bind-propagation" flag
when handling "bind" and "cache" mounts in `buildah run` or in RUN
instructions is one of the values that we would accept without the
"bind-propagation=" prefix.

Paul: fix merged conflict in tests (cherry-picked from 732f770648)

Fixes https://issues.redhat.com/browse/RHEL-61147
Fixes https://issues.redhat.com/browse/RHEL-61145

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-02 10:54:36 +02:00
openshift-merge-bot[bot] 138ca259d3
Merge pull request #5749 from TomSweeneyRedHat/dev/tsweeney/v1.37.3
[release-1.37] Bump to Buildah v1.37.3
2024-09-23 13:11:04 +00:00
tomsweeneyredhat 956095ee1c [release-1.37] Bump to Buildah v1.37.3
Bump to v1.37.3 in preparation of Podman v5.3

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-09-20 11:14:11 -04:00
openshift-merge-bot[bot] f0e0653ce5
Merge pull request #5746 from mheon/backport_5741
[release-1.37] Do not error on trying to write IMA xattr as rootless
2024-09-20 13:54:13 +00:00
Matt Heon 8165aae9e8 Do not error on trying to write IMA xattr as rootless
Rootless users cannot set the `security.ima` xattr on files
(presumably for security reasons, they get an EPERM on trying to
do so). We will normally try and preserve that xattr, so when
trying to add a file with an IMA xattr to a build on a Buildah
without this patch, you get an error. With this patch, the error
is downgraded to a warning, as it's better to successfully build
with a missing xattr than blocking all builds which want to
include the offending file.

The urgency on this has become somewhat higher as it seems like
F41/Rawhide are installing rpm-plugin-ima by default, which is
setting IMA xattrs on some files that Podman relies on - for
example, the catatonit binary we use for pid pause images.
Without this patch, building the pause image as rootless will
always fail on a system with rpm-plugin-ima installed.

Fixes: https://github.com/containers/podman/issues/18543

<MH: Cherry picked back to release-1.37, conflicts fixed>

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-09-19 14:47:48 -04:00
openshift-merge-bot[bot] b67fa4501c
Merge pull request #5735 from lsm5/release-1.37-packit-backports
[skip-ci] Release 1.37 packit backports
2024-09-17 13:27:46 +00:00
Daniel J Walsh 6edba982c8
Merge pull request #5739 from openshift-cherrypick-robot/cherry-pick-5728-to-release-1.37
[release-1.37] `manifest add --artifact`: handle multiple values
2024-09-16 11:55:03 -04:00
Daniel J Walsh 36a3a4a573
Merge pull request #5740 from nalind/compat-volumes-layers-1.37
[release-1.37] imagebuildah.StageExecutor: clean up volumes/volumeCache
2024-09-16 11:54:45 -04:00
Nalin Dahyabhai a47261ec11 imagebuildah.StageExecutor: clean up volumes/volumeCache
Clean up the distinctions between the volumes slice and the volumeCache
and volumeCacheInfo maps so that --compat-volumes will work correctly
when we're building with multiple layers.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-09-16 10:37:00 -04:00
Nalin Dahyabhai 7b28b9e4e6 `manifest add --artifact`: handle multiple values
Don't error out when `manifest add --artifact` is given multiple files,
and add a test which should have checked that.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-09-16 14:35:41 +00:00
Lokesh Mandvekar 8fb01fbc99
Packit: split out ELN jobs and reuse fedora downstream targets
ELN is kind of a midway between Fedora and RHEL, so it's best to mention
ELN jobs separately. This will also allow reusing fedora targets using
YAML anchors for TMT tests.

This commit also mentions fedora-40 targets separately for copr_build
jobs so that once fedora-41 is released, fedora-40 jobs continue to
trigger.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
(cherry picked from commit b2defd39e7)
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2024-09-13 16:47:44 +05:30
Lokesh Mandvekar a8f37392f0
Packit: Enable sidetags for bodhi updates
Packit now has sidetag support for adding multiple builds into a single
bodhi update.

Since we release c/ccommon, skopeo, buildah and podman often
almoost simultaneously, we should release them to Fedora in a single
bodhi update using sidetags so all builds can be tested together.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
(cherry picked from commit 0494df68b0)
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2024-09-13 16:04:31 +05:30
openshift-merge-bot[bot] dc2a5cb82e
Merge pull request #5699 from openshift-cherrypick-robot/cherry-pick-5654-to-release-1.37
[release-1.37] Use Epoch: 2 and respect the epoch in dependencies.
2024-08-21 17:03:39 +00:00
Jindrich Novy 1c0e94ec61 Use Epoch: 2 and respect the epoch in dependencies.
Signed-off-by: Jindrich Novy <jnovy@redhat.com>
2024-08-21 15:02:46 +00:00
openshift-merge-bot[bot] 96819d79b2
Merge pull request #5696 from TomSweeneyRedHat/dev/tsweeney/v1.37.3
[release-1.37] Bump Buildah to v1.37.2, c/common v0.60.2, c/image v5.32.2
2024-08-21 10:44:06 +00:00
tomsweeneyredhat eadda3bc0e [release-1.37] Bump Buildah to v1.37.2
As the title says.  Bumping to v1.37.2 in preparation for
Podman v5.2.2

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-08-20 15:34:38 -04:00
tomsweeneyredhat a18969dea0 [release-1.37] Bump c/common to v0.60.2, c/image to v5.32.2
As the title says.  Bumping to c/image v5.32.2 and c/common to v0.60.2
in preparation for Podman v5.2.2

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-08-20 15:34:17 -04:00
openshift-merge-bot[bot] 0117c423e9
Merge pull request #5681 from TomSweeneyRedHat/dev/tsweeney/v1.37.1
[release-1.37] Bump Buildah to v1.37.1, c/image v5.32.1, c/common to v0.60.1
2024-08-13 12:44:27 +00:00