RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2123251 - podman build and podman run read different seccomp.json file in the same environment
Summary: podman build and podman run read different seccomp.json file in the same envi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: podman
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Tom Sweeney
QA Contact: Joy Pu
URL:
Whiteboard:
: 2123246 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-01 08:51 UTC by Joy Pu
Modified: 2023-05-09 08:52 UTC (History)
10 users (show)

Fixed In Version: podman-4.3.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:41:58 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers buildah pull 4225 0 None Merged Use constants from containers/common for finding seccomp.json 2022-12-06 13:06:26 UTC
Red Hat Issue Tracker RHELPLAN-132951 0 None None None 2022-09-01 08:55:28 UTC
Red Hat Product Errata RHSA-2023:2282 0 None None None 2023-05-09 07:42:55 UTC

Description Joy Pu 2022-09-01 08:51:26 UTC
Description of problem:

If we install podman and cri-o together in one host. Than podman build and podman run will read different seccomp.json by default. This will cause the behave of podman build and podman run are different for some command.


Version-Release number of selected component (if applicable):
podman-4.2.0-3.el9.x86_64

How reproducible:
100 %


Steps to Reproduce:
1. Install podman and cri-o in your host. So there will be two seccomp file in your system:
/etc/crio/seccomp.json (from cri-o)
 /usr/share/containers/seccomp.json (from container-common)

2. Try to install package from podman run and podman build
For podman build:
$ cat Dockerfile 
FROM registry.fedoraproject.org/fedora:36
RUN dnf -y install systemd dnsmasq iproute iputils && dnf clean all && systemctl enable dnsmasq
$ podman  build --no-cache -t dnsmasq .
STEP 1/2: FROM registry.fedoraproject.org/fedora:36
STEP 2/2: RUN dnf -y install systemd dnsmasq iproute iputils && dnf clean all && systemctl enable dnsmasq
Fedora 36 - x86_64                              0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'fedora':
  - Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-36&arch=x86_64 [getaddrinfo() thread failed to start]
Error: Failed to download metadata for repo 'fedora': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-36&arch=x86_64 [getaddrinfo() thread failed to start]
Error: error building at STEP "RUN dnf -y install systemd dnsmasq iproute iputils && dnf clean all && systemctl enable dnsmasq": error while running runtime: exit status 1

For podman run:
$ podman --log-level debug run -it --rm --name test registry.fedoraproject.org/fedora:36 dnf -y install systemd dnsmasq iproute iputils



Actual results:
podman build read the /etc/crio/seccomp.json and failed to resolve hostname
podman run read /usr/share/containers/seccomp.json and finished succeed. 



Expected results:
podman build should also read /usr/share/containers/seccomp.json as podman run did and finished as expected.

Additional info:

Comment 1 Joy Pu 2022-09-01 08:53:52 UTC
Thanks Huijing found this and add her in the cc list for status update

Comment 2 Tom Sweeney 2022-09-01 17:47:29 UTC
Aditya, can you look at this.  I suspect this is really an issue with Buildah rather than Podman.

Comment 3 Daniel Walsh 2022-09-04 11:25:38 UTC
Fixes in https://github.com/containers/buildah/pull/4219

Comment 4 Tom Sweeney 2022-09-07 14:07:54 UTC
Assigning to Jindrich for any further packaging or BZ needs.

Comment 5 Jindrich Novy 2022-12-01 11:58:13 UTC
Dan, Tom, the https://github.com/containers/buildah/pull/4219 is against buildah - is there a similar PR against podman? I don't see it in the podman code yet. Thanks.

Comment 7 Daniel Walsh 2022-12-04 22:23:37 UTC
Yes you are right we should be reading /usr/share/containers/seccomp.json.

Comment 8 Daniel Walsh 2022-12-04 22:28:13 UTC
Nalin fixed it correctly in 4407875a50dbfa237dde404835278526f68161b4 to get the constant out of containers.conf.

This is in podman 4.3.1

Comment 9 Tom Sweeney 2022-12-06 02:16:07 UTC
Just adding a link to Nalin's fix in the Buildah main branch: https://github.com/containers/buildah/pull/4225

Comment 13 Joy Pu 2022-12-29 08:58:01 UTC
Test with podman-4.3.1-3.el9.x86_64, the build command already read from /usr/share/containers/seccomp.json. So move this bug to verified.
# podman --log-level debug  build --no-cache -t dnsmasq . 2>&1 |grep seccomp.json
time="2022-12-29T03:42:02-05:00" level=debug msg="Resources: &define.CommonBuildOptions{AddHost:[]string{}, OmitHistory:false, CgroupParent:\"\", CPUPeriod:0x0, CPUQuota:0, CPUShares:0x0, CPUSetCPUs:\"\", CPUSetMems:\"\", HTTPProxy:true, IdentityLabel:0x1, Memory:0, DNSSearch:[]string{}, DNSServers:[]string{}, DNSOptions:[]string{}, LabelOpts:[]string(nil), MemorySwap:0, NoHosts:false, OmitTimestamp:false, SeccompProfilePath:\"/usr/share/containers/seccomp.json\", ApparmorProfile:\"\", ShmSize:\"65536k\", Ulimit:[]string{}, Volumes:[]string{}, Secrets:[]string{}, SSHSources:[]string{}, OCIHooksDir:[]string{}}"

Comment 14 Joy Pu 2022-12-29 08:58:46 UTC
More details:
# find / -name "seccomp.json"
/etc/crio/seccomp.json
/usr/share/containers/seccomp.json

Comment 15 Peter Hunt 2023-02-14 15:21:44 UTC
*** Bug 2123246 has been marked as a duplicate of this bug. ***

Comment 17 errata-xmlrpc 2023-05-09 07:41:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: podman security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2282


Note You need to log in before you can comment on or make changes to this bug.