Commit graph

17919 commits

Author SHA1 Message Date
Daniel J Walsh
a6508a2568
Merge pull request #22286 from TomSweeneyRedHat/dev/tsweeney/v4.4.1-rhel_inspect_dev
[v4.4.1-rhel] inspect: ignore ENOENT during device lookup
2024-04-06 07:10:59 -04:00
Paul Holzinger
b1442ba30c [v4.4.1-rhel] inspect: ignore ENOENT during device lookup
When we walk the /dev tree we need to lookup all device paths. Now in
order to get the major and minor version we have to actually stat each
device. This can again fail of course. There is at least a race between
the readdir at stat call so it must ignore ENOENT errors to avoid
the race condition as this is not a user problem. Second, we should
also not return other errors and just log them instead, returning an
error means stopping the walk and returning early which means inspect
fails with an error which would be bad.

Also there seems to be cases were ENOENT will be returned all the time,
e.g. when a device is forcefully removed. In the reported bug this is
triggered with iSCSI devices.

Because the caller does already lookup the device from the created map
it reports a warning there if the device is missing on the host so it
is not a problem to ignore a error during lookup here.

[NO NEW TESTS NEEDED] Requires special device setup to trigger
consistentlyand we cannot do that in CI.

Original Fixed https://issues.redhat.com/browse/RHEL-11158

This fixes: https://issues.redhat.com/browse/RHEL-20488

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-04-05 16:18:05 -04:00
openshift-merge-bot[bot]
981e986f89
Merge pull request #22194 from TomSweeneyRedHat/cve-v4.4.1-rhel
[v4.4.1-rhel] Bump Buildah to v1.29.3 CVE-2024-1753
2024-03-28 19:32:32 +00:00
tomsweeneyredhat
e79c35238e [v4.4.1-rhel] Bump Buildah to v1.29.3 CVE-2024-1753
As the title says, buming to Buildah v1.29.3 to address:
CVE-2024-1753
https://issues.redhat.com/browse/RHEL-26762 and probably another card
TBD

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-03-27 20:55:27 -04:00
openshift-merge-bot[bot]
80daf82887
Merge pull request #22059 from TomSweeneyRedHat/dev/tsweeney/deadlockfix_4.4.1
[v4.4.1-rhel] libpod: fix deadlock while parallel container create
2024-03-18 15:49:08 +00:00
Paul Holzinger
9ef352adfc [v4.4.1-rhel] libpod: fix deadlock while parallel container create
Cherry pick from #20329
Addresses: https://issues.redhat.com/browse/RHEL-14744 and
https://issues.redhat.com/browse/RHEL-14743

When containers are created with a named volume it can deadlock because
the create logic tried to lock all volumes in a loop, this is fine if it
only ever creates a single container at any given time. However because
we multiple containers can be created at the same time they can cause a
deadlock between the volumes. This is because the order of the loop is
not stable, in fact it is based on the order of how the volumes were
specified on the cli.

So if you create two containers at the same time with
`-v vol1:/dir2 -v vol2:/dir2` and the other one with
`-v vol2:/dir2 -v vol1:/dir1` then there is chance for a deadlock.

Now one solution could be to order the volumes to prevent the issue but
the reason for holding the lock is dubious. The goal was to prevent the
volume from being removed in the meantime. However that could still
have happend before we acquired the lock so it didn't protect against
that.

Both boltdb and sqlite already prevent us from adding a container with
volumes that do not exists due their internal consistency checks.
Sqlite even uses FOREIGN KEY relationships so the schema will prevent us
from doing anything wrong.

The create code currently first checks if the volume exists and if not
creates it. I have checked that the db will guarantee that this will not
work:
Boltdb: `no volume with name test2 found in database when adding container xxx: no such volume`
Sqlite: `adding container volume test2 to database: FOREIGN KEY constraint failed`

Keep in mind that this error is normally not seen, only if the volume is
removed between the volume exists check and adding the container in the
db this messages will be seen wich is an acceptable race and a
pre-existing condition anyway.

[NO NEW TESTS NEEDED] Race condition, hard to test in CI.

Fixes #20313

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-03-15 16:13:29 -04:00
openshift-merge-bot[bot]
a0fcaa87b5
Merge pull request #21662 from TomSweeneyRedHat/dev/tsweeney/4.4.1-rhel_net_10
[v4.4.1-rhel] Bump golang.org/x/net to v0.13.0
2024-02-15 11:46:46 +00:00
tomsweeneyredhat
c651132ef2 [v4.4.1-rhel] Bump golang.org/x/net to v0.13.0
As the title says.  Bump golang.org/x/net to v0.13.0.

Addresses: https://issues.redhat.com/browse/OCPBUGS-17313

CVE-2023-3978

[NO NEW TESTS NEEDED]
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-02-14 15:32:07 -05:00
openshift-merge-bot[bot]
865f6b493e
Merge pull request #21480 from mheon/bump_runc_441rhel
[v4.4.1-rhel] Update runc to v1.1.12
2024-02-02 18:23:48 +00:00
Ed Santiago
4a58adfb7f systests: kube with policies test: fix race
Add a wait_for_ready() to one kube-play test, to make sure
container output has made it to the journal.

Probably does not fix #18501, but I think it might fix its
most common presentation.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-02-02 09:27:23 -05:00
Matt Heon
cb799fd19e Fix updated runc dep breaking pod devices cgroup
The update to runc broke creation of devices for containers in
the pod cgroup. We don't support the device cgroup for pods at
present, so just disable it for now, resolving the issue.

Thanks to Giuseppe for finding the fix.

[NO NEW TESTS NEEDED] fixes a test break

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 09:26:40 -05:00
Matt Heon
fd07c085f4 Bump to runc v1.1.12
Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 09:25:17 -05:00
openshift-merge-bot[bot]
5aeef8057d
Merge pull request #21144 from lsm5/v4.4.1-rhel-crypto-bump
[v4.4.1-rhel] bump golang.org/x/crypto to v0.17.0
2024-01-04 15:34:01 +00:00
Ed Santiago
2fe6265079
(Temporary) Emergency CI fix: quay search is broken
Someone please revert this once quay search is fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
(cherry picked from commit 047da19b5f)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-01-04 18:48:28 +05:30
Lokesh Mandvekar
1aaff8d52d
bump golang.org/x/crypto to v0.17.0
Fixes: GHSA-45x7-px36-x8w8 CVE-2023-48795

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-01-04 17:22:16 +05:30
OpenShift Merge Robot
b9594a7be0
Merge pull request #19971 from TomSweeneyRedHat/dev/tsweeney/bumpstore_1.45.6
[v4.4.1-rhel] WIP vendor c/storage v1.45.6
2023-09-15 16:35:37 +02:00
TomSweeneyRedHat
c346d69e3b [v4.4.1-rhel] vendor c/storage v1.45.6
This backport a fix for c/storage for unlink functionaliy from https://github.com/containers/storage/pull/1631/

This was a WIP, but has been updated and is ready to merge, assuming
happy tests.

[NO NEW TESTS NEEDED]

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2023-09-14 17:53:53 -04:00
OpenShift Merge Robot
dd490ff943
Merge pull request #19632 from mheon/backport_18577_441rhel
Backport #18577 to v4.4.1-rhel
2023-08-16 16:23:53 -02:30
Chris Evich
523d49d977 [v4.4.1-rhel] Fix AttributeError: cython_sources
Apparent Cython regression causing a warning and traceback when
installing PyYAML with pip:

Ref. Upstream issue 601: https://github.com/yaml/pyyaml/issues/

Ref. warning message:
```
********************************************************************************
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
```

Ref. traceback snippet:
```
Traceback (most recent call last):
  File "/var/tmp/go/src/github.com/containers/podman/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
...cut...
  File "<string>", line 201, in get_source_files
  File "/tmp/pip-build-env-yiijk0jv/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
    raise AttributeError(attr)
AttributeError: cython_sources
```

Signed-off-by: Chris Evich <cevich@redhat.com>

<MH: Cherry-pick back to v4.4.1-rhel>

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-08-15 12:40:42 -04:00
Daniel J Walsh
e0654150d0 Support podman --remote when Containerfile is not in context directory
Fixes: https://github.com/containers/podman/issues/18239

[NO NEW TESTS NEEDED]

@test "podman build -f test" in test/system/070-build.bats

Will test this.  This was passing when run on a local system since
the remote end was using the clients path to read the Containerfile
The issue is it would not work in a podman machine since the
Containerfile would/should be a different path.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

<MH: Cherry-pick to v4.4.1-rhel>

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-08-15 09:46:28 -04:00
OpenShift Merge Robot
ff30585bad
Merge pull request #18841 from mheon/backport_for_2213843
[v4.4.1-rhel] Backports for RHBZ 2213843
2023-06-13 03:28:33 -04:00
Matt Heon
35537de4c7 Fix several issues with image volumes
Particularly, fix an issue with SELinux where image volumes would
not mount properly.

Based (loosely) on 2ec11b16ab which
intermingled these changes with other fixes not relevant to this
backport.

Backported to v4.4.1-rhel per RHBZ 2213843

[NO NEW TESTS NEEDED]

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-12 13:31:39 -04:00
OpenShift Merge Robot
bcea4460bf
Merge pull request #18695 from Luap99/v4.4.1-rhel
[v4.4.1-rhel] Add new bclim macvlan option
2023-05-29 07:05:24 -04:00
Paul Holzinger
7079515858
network-create: document new bclim option
see https://github.com/containers/common/pull/1475
https://bugzilla.redhat.com/show_bug.cgi?id=2210113
https://bugzilla.redhat.com/show_bug.cgi?id=2210111

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-26 10:08:49 +02:00
Paul Holzinger
10e879c6a1
update c/common to v0.51.3
Addresses:
https://bugzilla.redhat.com/show_bug.cgi?id=2210113
https://bugzilla.redhat.com/show_bug.cgi?id=2210111

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-26 10:08:44 +02:00
OpenShift Merge Robot
8b741dcacb
Merge pull request #18406 from cevich/v4.4.1-rhel_disable_windows
[v4.4.1-rhel] Cirrus: Disable windows CI testing
2023-05-02 08:49:41 -04:00
Chris Evich
f90a671c14
Cirrus: Disable windows CI testing
On 4-24-2023 the `Windows Smoke Test` suddenly started failing.  While
it would be informative to find out why, this is a RHEL-centric release
branch.  Therefore, Windows testing is unnecessary and unhelpful.
Disable it.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-05-01 13:59:20 -04:00
Ed Santiago
aa5db476a8
Merge pull request #18347 from TomSweeneyRedHat/dev/tsweeney/4.4.1-preexec
[v4.4.1-rhel] Add file switch for pre-exec hooks
2023-04-26 10:30:23 -06:00
tomsweeneyredhat
3db7f4caf2 [v4.4.1-rhel] Add file switch for pre-exec hooks
The long term goal was to provide the customer with a way to turn on the
preexec_hooks processing of scripts by having some kind of configuration
that could be read. I had tried putting it into containers.conf to
start, but that turned out to be unyieldly quickly, and time is of
the essence for this fix. That is mostly due to the fact that this
code is preexecution and in C, the containers.conf file is read in
Go much further down the stack.

After first trying this process using an ENVVAR, I have
thought it over and chatted with others, and will now look for a
/etc/containers/podman_preexec_hooks.txt file to exist. If the admin
had put one in there, we will then process the files in the
directories /usr/libexec/podman/pre-exec-hooks
and /etc/containers/pre-exec-hooks.

Thoughts/suggestions gratefully accepted. This will be a 8.8/9.2 ZeroDay
fix and will need to be backported to the v4.4.1-rhel branch.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-04-26 10:12:54 -04:00
OpenShift Merge Robot
fd0ea3b971
Merge pull request #18172 from TomSweeneyRedHat/dev/tsweeney/store1.45.5
[v4.4.1-rhel] Vendor c/storage v1.45.5
2023-04-13 13:31:31 -04:00
tomsweeneyredhat
b458fc63d2 [v4.4.1-rhel] Vendor c/storage v1.45.5
Vendor in c/storage v1.45.5

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2177925 and
https://bugzilla.redhat.com/show_bug.cgi?id=2176833

"Podman containers do not start after upgrade to v4.4.1 "

ZeroDay BZs for RHEL 8.8 and 9.2

Repushed with v1.45.5 after it was found that v1.45.4 was built
incorrectly from main.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-04-13 08:44:36 -04:00
OpenShift Merge Robot
05037d301b
Merge pull request #18006 from TomSweeneyRedHat/dev/tsweeney/dockerlog
[v4.4.1-rhel] compat: /auth: parse server address correctly
2023-04-03 04:40:59 -04:00
Valentin Rothberg
3101c8be24 [v4.4.1-rhel] compat: /auth: parse server address correctly
Use `auth.Login` as `podman login` does which parses and normalizes the
input addresses correctly, especially for docker.io.

This Cherry Picks https://github.com/containers/podman/pull/17581 and
brings in necessary changes to run_test.go from i
5f86fae71f

Addreses: https://bugzilla.redhat.com/show_bug.cgi?id=2183601 and
https://bugzilla.redhat.com/show_bug.cgi?id=2183602 for the RHEL 8.8 and
9.2 ZeroDay

The original Fixed: #17571
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-03-31 16:10:16 -04:00
OpenShift Merge Robot
67f7e1e941
Merge pull request #17969 from TomSweeneyRedHat/dev/tsweeney/keepid
[v4.4.1-rhel] fix slirp4netns resolv.conf ip with a userns
2023-03-29 17:58:49 +02:00
Paul Holzinger
62d347488a [v4.4.1-rhel] fix slirp4netns resolv.conf ip with a userns
When a userns is set we setup the network after the bind mounts, at the
point where resolv.conf is generated we do not yet know the subnet.
Just like the other dns servers for bridge networks we need to add the
ip later in completeNetworkSetup()

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2182492 and
https://bugzilla.redhat.com/show_bug.cgi?id=2182491

This is targeted to RHEL 8.8 and 9.2 ZeroDay

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-03-28 18:11:25 -04:00
OpenShift Merge Robot
4461c9c8b2
Merge pull request #17875 from edsantiago/v441rhel_rootless_journal_skip
quadlet tests: skip on RHEL8 rootless
2023-03-22 04:42:31 -04:00
Ed Santiago
ab0bbf7ba0 quadlet tests: skip on RHEL8 rootless
skip in setup() if journald unavailable.

To be pedantic, this is overkill: some quadlet tests pass
because they don't run journald. Too bad.

Also skip a play-kube test that requires journal

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-21 09:05:32 -06:00
OpenShift Merge Robot
bf400bd36f
Merge pull request #17863 from vrothberg/v4.4.1-rhel-backport-fix-17777
[v4.4.1-rhel] fix --health-on-failure=restart in transient unit
2023-03-21 07:29:21 -04:00
Valentin Rothberg
a2e80c53d4 [v4.4.1-rhel] fix --health-on-failure=restart in transient unit
As described in #17777, the `restart` on-failure action did not behave
correctly when the health check is being run by a transient systemd
unit.  It ran just fine when being executed outside such a unit, for
instance, manually or, as done in the system tests, in a scripted
fashion.

There were two issue causing the `restart` on-failure action to
misbehave:

1) The transient systemd units used the default `KillMode=cgroup` which
   will nuke all processes in the specific cgroup including the recently
   restarted container/conmon once the main `podman healthcheck run`
   process exits.

2) Podman attempted to remove the transient systemd unit and timer
   during restart.  That is perfectly fine when manually restarting the
   container but not when the restart itself is being executed inside
   such a transient unit.  Ultimately, Podman tried to shoot itself in
   the foot.

Fix both issues by moving the restart logic in the cleanup process.
Instead of restarting the container, the `healthcheck run` will just
stop the container and the cleanup process will restart the container
once it has turned unhealthy.

Backport of commit 9563415430.

Fixes: #17777
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2180125
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2180126
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-21 09:18:42 +01:00
OpenShift Merge Robot
ffc2614b8e
Merge pull request #17790 from TomSweeneyRedHat/dev/tsweeney/pick17755
[v4.4.1-rhel] Use append() to add elements to a slice (restore)
2023-03-16 11:15:22 -04:00
OpenShift Merge Robot
5464dbc2f6
Merge pull request #17810 from lsm5/v4.4.1-rhel-cve-2022-41723
[v4.4.1-rhel] bump golang.org/x/net to v0.8.0
2023-03-16 11:09:10 -04:00
Lokesh Mandvekar
75d0b4a787
bump golang.org/x/net to v0.8.0
Resolves: CVE-2022-41723

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-03-16 15:39:58 +05:30
tomsweeneyredhat
6b64861922 [v4.4.1-rhel] Use append() to add elements to a slice (restore)
Backports #17755 from @adrianreber to fix an append issue.  Will be
used for a ZeroDay delivery to RHEL 8.8/9.2.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2177611

Original commit message:

The code was not using append() to add items to a slice.

Accessing non allocated elements of the slice failed with:
```
$ podman container restore -l
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/containers/podman/v4/pkg/domain/infra/abi.(*ContainerEngine).ContainerRestore(0xc00051a8b8, {0x1dbced0, 0xc0000440d0}, {0x2a31b30, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0, ...})
        /share/go/src/github.com/containers/podman/pkg/domain/infra/abi/containers.go:676 +0x39c
github.com/containers/podman/v4/cmd/podman/containers.restore(0x28fb6c0?, {0xc0002c9080, 0x0, 0x1?})
        /share/go/src/github.com/containers/podman/cmd/podman/containers/restore.go:171 +0x4ef
github.com/spf13/cobra.(*Command).execute(0x28fb6c0, {0xc0000400b0, 0x1, 0x1})
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x291ab00)
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:961
main.Execute()
        /share/go/src/github.com/containers/podman/cmd/podman/root.go:107 +0xcc
main.main()
        /share/go/src/github.com/containers/podman/cmd/podman/main.go:41 +0x7c
```

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-03-14 19:52:14 -04:00
OpenShift Merge Robot
e1703bb7f4
Merge pull request #17531 from edsantiago/rhel8_test_skips
RHEL8 gating-test skips and tweaks
2023-02-20 13:36:38 +01:00
OpenShift Merge Robot
d865e23c6e
Merge pull request #17570 from openshift-cherrypick-robot/cherry-pick-17548-to-v4.4.1-rhel
[v4.4.1-rhel] kube play: only enforce passthrough in Quadlet
2023-02-20 12:48:49 +01:00
Valentin Rothberg
9ca3d1c28e kube play: only enforce passthrough in Quadlet
Only enforce the passthrough log driver for Quadlet. Commit 68fbebf
introduced a regression on the `podman-kube@` template as `podman logs`
stopped working and settings from containers.conf were ignored.

Fixes: #17482
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-20 07:53:56 +00:00
OpenShift Merge Robot
0b38633c42
Merge pull request #17559 from TomSweeneyRedHat/dev/tsweeney/fixsecret4.4.1
[v4.4.1-rhel] [CI:DOCS] Touch up secret man page
2023-02-18 13:59:10 +01:00
OpenShift Merge Robot
5a3b9834ec
Merge pull request #17558 from openshift-cherrypick-robot/cherry-pick-17554-to-v4.4.1-rhel
[v4.4.1-rhel] [CI:BUILD] Revert "CI: Temporarily disable all AWS EC2-based tasks"
2023-02-18 13:53:58 +01:00
tomsweeneyredhat
7ddac33de9 [v4.4.1-rhel] [CI:DOCS] Touch up secret man page
This is a working theory fix.  The man pages including the
secret.md option are not resolving properly.  The secret.md
file is the only one with a text line with three back ticks on the start
and end of the line.  Elsewhere we have the backticks on separate lines
and the text in it's own line.

This might not fix the issue, but at the very least it makes things
consistent.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-02-17 15:05:59 -05:00
Chris Evich
07b72bcf99 Revert "CI: Temporarily disable all AWS EC2-based tasks"
This reverts commit 7f8bc6f510.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-17 18:42:41 +00:00