Commit Graph

29965 Commits

Author SHA1 Message Date
Matt Heon 491d72e9f2 Use securejoin.SecureJoin when forming userns paths
We need to read /etc/passwd and /etc/group in the container to
get an idea of how many UIDs and GIDs we need to allocate for a
user namespace when `--userns=auto` is specified. We were forming
paths for these using filepath.Join, which is not safe for paths
within a container, resulting in this CVE allowing crafted
symlinks in the container to access paths on the host instead.

Addresses CVE-2024-9676

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-14 12:36:11 -04:00
openshift-merge-bot[bot] f53884cb5f
Merge pull request #2131 from containers/renovate/major-ci-vm-image
chore(deps): update dependency containers/automation_images to v20241010
2024-10-14 10:03:39 +00:00
renovate[bot] 6f775576dd
chore(deps): update dependency containers/automation_images to v20241010
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-11 19:47:08 +00:00
openshift-merge-bot[bot] 9f9b9490d1
Merge pull request #2129 from mheon/fix_quotas
Fix assignment of quota project IDs
2024-10-11 19:46:33 +00:00
openshift-merge-bot[bot] 8a28ece914
Merge pull request #2132 from containers/renovate/github.com-klauspost-compress-1.x
fix(deps): update module github.com/klauspost/compress to v1.17.11
2024-10-11 15:23:29 +00:00
renovate[bot] c9fc830ff7
fix(deps): update module github.com/klauspost/compress to v1.17.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-11 14:06:28 +00:00
Matt Heon ffeddaae99 Strip PROJINHERIT flag from top-level dir of quotas
Basically, PROJINHERIT causes all lower-level directories to get
the same project ID. This is a good thing for the directories
that are supposed to have quotas. It is not a nice thing for the
top-level directory. We set a project ID on that directory so we
know what the base ID is for our subdirectories to use, but we do
not want that ID propagated to subdirectories else everything
will end up using that single quota ID. Stripping the flag from
the top-level directory (if it is present) resolves this.

Partial fix for https://issues.redhat.com/browse/RHEL-18038

Full fix also requires Podman changes as we were setting quotas
on the incorrect directory.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-10 10:01:05 -04:00
Matt Heon 0e3bd23fbb Revert "Fix assignment of quota IDs for XFS quotas"
This reverts commit f4c8d96190.

We do actually require the PROJINHERIT flag for proper operation.
The trick is that we have to remove it on the top-level directory
(which requires having the flag defined). Revert this commit as
such.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-10 09:32:42 -04:00
openshift-merge-bot[bot] 250a170db0
Merge pull request #2127 from containers/renovate/github.com-cyphar-filepath-securejoin-0.x
fix(deps): update module github.com/cyphar/filepath-securejoin to v0.3.4
2024-10-09 10:44:18 +00:00
renovate[bot] 8a7b6676e8
fix(deps): update module github.com/cyphar/filepath-securejoin to v0.3.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-09 04:36:53 +00:00
openshift-merge-bot[bot] a397602515
Merge pull request #2123 from kimminss0/zfs-tolerate-already-removed-layer-deletion
drivers/zfs: Handle missing layers during image deletion in ZFS file system
2024-10-08 18:55:03 +00:00
openshift-merge-bot[bot] 52c0d3ef7f
Merge pull request #2122 from Honny1/fix-clone-copy
Fix copy/clone of empty value
2024-10-08 18:52:21 +00:00
openshift-merge-bot[bot] 6c1c6d227f
Merge pull request #2121 from Honny1/git-validation
CI: Fix `git-validation.sh`
2024-10-08 18:49:47 +00:00
Jan Rodák 5537f8ab2d
Revert the use of the slices.Clone function
because it does not return nil when the slice length is 0.
This behavior caused the slices.Clone function to allocate
a unnecessary amount of memory when the slice length is 0,
and the c/common tests failed.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-10-08 14:26:51 +02:00
Minseo Kim d9e4f1e58c drivers/zfs: continue to delete images even if the layer has already been removed
Signed-off-by: Minseo Kim <kimminss0@outlook.kr>
2024-10-08 00:52:21 +09:00
openshift-merge-bot[bot] 9dc388169a
Merge pull request #2125 from baude/OWNERS.update
Audit and update OWNERS file
2024-10-07 08:15:37 +00:00
openshift-merge-bot[bot] ecfdc25efa
Merge pull request #2124 from containers/renovate/golang.org-x-sys-0.x
fix(deps): update module golang.org/x/sys to v0.26.0
2024-10-04 22:14:27 +00:00
Brent Baude 3d1014dda6 Audit and update OWNERS file
Just performing an audit and cleanup of the OWNERS file.  Cleaned out
duplicate reviewer entries as well.  Made judgement calls on the names
based on the last 24 months of contributions, etc.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-10-04 13:16:59 -05:00
renovate[bot] 9b5b7112e2
fix(deps): update module golang.org/x/sys to v0.26.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-04 15:10:28 +00:00
openshift-merge-bot[bot] 0eb3a02315
Merge pull request #2118 from giuseppe/define-error-for-unsupported-partial-pulls
chunked: define error for partial pulls not available
2024-10-02 20:31:17 +00:00
Giuseppe Scrivano ed132480d3
chunked: define error for partial pulls not available
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: https://github.com/containers/storage/issues/2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-02 17:13:25 +02:00
Jan Rodák 7abefb584a
Fix git-validation.sh to run in cirrus CI
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-10-02 16:58:31 +02:00
Giuseppe Scrivano 3bbd19c9dc
chunked: drop special handling for "< 64" ranges
Avoid handling cases where the server doesn't support at least 64
ranges in a request, in order to prevent falling back to the
traditional pull mechanism.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-02 15:49:20 +02:00
openshift-merge-bot[bot] 4bf3f075cf
Merge pull request #2120 from containers/renovate/github.com-cyphar-filepath-securejoin-0.x
fix(deps): update module github.com/cyphar/filepath-securejoin to v0.3.3
2024-09-30 16:17:46 +00:00
renovate[bot] 06e354355d
fix(deps): update module github.com/cyphar/filepath-securejoin to v0.3.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 15:22:00 +00:00
openshift-merge-bot[bot] 603ff90cd1
Merge pull request #2119 from giuseppe/chunked-ignore-layer-unknown
chunked: ignore ErrLayerUnknown when creating cache
2024-09-30 10:56:29 +00:00
Giuseppe Scrivano e3664d50e0
chunked: ignore ErrLayerUnknown when creating cache
ignore the error if the layer is being deleted while we are processing
it without a lock on the store.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-09-30 10:12:43 +02:00
openshift-merge-bot[bot] c90a35bdc0
Merge pull request #2116 from mtrmac/tar-split
Use tar-split/tar/asm.IterateHeaders now that it has been accepted
2024-09-27 22:34:52 +00:00
openshift-merge-bot[bot] 17ceb4d9aa
Merge pull request #2111 from containers/renovate/github.com-moby-sys-capability-0.x
fix(deps): update module github.com/moby/sys/capability to v0.3.0
2024-09-27 22:26:38 +00:00
Miloslav Trmač 39e467aa53 Use tar-split/tar/asm.IterateHeaders now that it has been accepted
... instead of our version which makes assumptions on the
internal decisions of the tar-split project, and needs heuristics
to guess where file padding ends.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-09-27 19:47:25 +02:00
renovate[bot] 8d460cfd10
fix(deps): update module github.com/moby/sys/capability to v0.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-27 14:28:55 +00:00
openshift-merge-bot[bot] f45f1ed2f9
Merge pull request #2114 from containers/renovate/github.com-vbatts-tar-split-0.x
fix(deps): update module github.com/vbatts/tar-split to v0.11.6
2024-09-27 14:28:20 +00:00
renovate[bot] ddbe5d99a3
fix(deps): update module github.com/vbatts/tar-split to v0.11.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-27 07:05:58 +00:00
openshift-merge-bot[bot] 3eafe4c515
Merge pull request #2112 from giuseppe/composefs-add-fallback-no-dataonly-layers
overlay: fallback without data only layers
2024-09-27 07:05:21 +00:00
openshift-merge-bot[bot] 42fbe2d3e6
Merge pull request #2102 from kolyshkin/revive
Assorted nits reported by revive linter
2024-09-26 18:29:20 +00:00
openshift-merge-bot[bot] 2f4e5321ac
Merge pull request #2110 from containers/renovate/github.com-microsoft-hcsshim-0.x
fix(deps): update module github.com/microsoft/hcsshim to v0.12.7
2024-09-26 18:26:23 +00:00
Giuseppe Scrivano 85660fce29
overlay: fallback without data only layers
if the overlay data only layers feature is not available, then use a
regular overlay lower layer.

The same functionality is already present in the mount helper for
composefs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-09-26 16:13:03 +02:00
renovate[bot] a22f08052a
fix(deps): update module github.com/microsoft/hcsshim to v0.12.7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-25 21:40:18 +00:00
openshift-merge-bot[bot] 42f7874392
Merge pull request #2107 from giuseppe/refactor-get-staging-dir-code
overlay: refactor getStagingDir helper
2024-09-25 18:37:57 +00:00
openshift-merge-bot[bot] d5fb6c11e1
Merge pull request #2108 from ktock/additonal-layer-check
overlay: additional layer: check layer existence before using
2024-09-24 20:51:43 +00:00
openshift-merge-bot[bot] ebd463a126
Merge pull request #2101 from kolyshkin/gofix
Remove old +build tags, add gofix ci job
2024-09-24 20:49:00 +00:00
Kohei Tokunaga defaae68b1
overlay: additional layer: check layer existence before using
Currently *Driver.get doesn't check existence of additional layers.
This result in an unclear error.
This commit fixes that function to check the existence of additional layers
before using and return a clear error.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-09-25 05:18:30 +09:00
Giuseppe Scrivano 7f302331e7
overlay: refactor getStagingDir helper
simplify the implementation of getStagingDir() to just create a new
staging directory and drop the check whether the correct staging base
directory as anyway the rename operation would fail later.

Closes: https://github.com/containers/storage/issues/2092

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-09-24 21:00:24 +02:00
openshift-merge-bot[bot] 5924c6f0ad
Merge pull request #2109 from giuseppe/skip-nogroup
userns: skip "nogroup"
2024-09-24 18:01:16 +00:00
Giuseppe Scrivano 76f8b26a7f
userns: skip "nogroup"
the alpine image defines a "nogroup":

$ podman run --rm alpine grep nogroup /etc/group
nogroup65533:

ignore it as we are already doing for the "nobody" user.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-09-24 18:34:29 +02:00
openshift-merge-bot[bot] 205caa7ccf
Merge pull request #2100 from kolyshkin/cut
Use strings.Cut{,Prefix,Suffix} where appropriate
2024-09-24 16:24:10 +00:00
openshift-merge-bot[bot] 8338c56674
Merge pull request #2106 from containers/renovate/github.com-klauspost-compress-1.x
fix(deps): update module github.com/klauspost/compress to v1.17.10
2024-09-23 18:14:52 +00:00
renovate[bot] cdd3309528
fix(deps): update module github.com/klauspost/compress to v1.17.10
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-23 13:25:50 +00:00
openshift-merge-bot[bot] 5198cc7c89
Merge pull request #2105 from giuseppe/fix-off-by-one-max-size
userns: fix off-by-one userns max size detection
2024-09-23 13:25:00 +00:00
openshift-merge-bot[bot] 5a3217d8f2
Merge pull request #2103 from kolyshkin/cap
Switch to github.com/moby/sys/capability
2024-09-23 13:16:42 +00:00