Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2116922

Summary: podman creates lock file in /etc/cni/net.d/cni.lock instead of /run/lock/
Product: Red Hat Enterprise Linux 8 Reporter: vikas.goel <vikas.goel>
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: Yuhui Jiang <yujiang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.6CC: bbaude, dornelas, dwalsh, jligon, jnovy, lfriedma, lsm5, mheon, pthomas, toneata, tsweeney, umohnani, vikas.goel, ypu
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: podman-4.3.1-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2123905 2125644 (view as bug list) Environment:
Last Closed: 2023-05-16 08:20:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2123905, 2125644    

Description vikas.goel@veritas.com 2022-08-09 14:35:34 UTC
Description of problem: When a root account login is presented a read-only root file-system using chroot, all podman commands fail because they try to create a lock file in /etc/cni/net.d/cni.lock that is read-only. The podman commands succeed as soon as /etc/cni/net.d/ directory is made writable in the chroot'ed environment.


Version-Release number of selected component (if applicable): RHEL 8.6, podman 4.0.2


How reproducible: Create a chroot'ed environment where root file-system is mounted in read-only mode for security hardening. Login as root in the hardened environment. Execute podman command.


Steps to Reproduce:
1. Create a chroot'ed environment where root file-system is bind mounted in read-only mode for security hardening.
2. Bind mount /run, /tmp and /var/log in read-write
3. Login as root in the hardened environment
4. Execute podman commands

Actual results:
[root@rhel8-appliance /]# podman volume ls
Error: error opening "/etc/cni/net.d/cni.lock": read-only file system
[root@rhel8-appliance /]#


Expected results:
[root@rhel8-appliance /]# podman volume ls
DRIVER      VOLUME NAME
veritas     etcd_data
veritas     metrics_data
[root@rhel8-appliance /]#


Additional info:

Comment 3 Derrick Ornelas 2022-08-15 18:35:27 UTC
Do we know if this is a regression from a previous version of podman, or has this always been the behavior?

Comment 4 Tom Sweeney 2022-08-16 17:40:38 UTC
Derrick, I'm going to guess this was a problem starting with Podman v4.0 once we changed the network stacks around.  @mheon any differing thoughts?

Comment 5 Matthew Heon 2022-08-16 17:49:48 UTC
Nope, this existed well prior to that. The lock has existed for 2 years, and it was moved to its current location in the config directory via https://github.com/containers/podman/commit/836fa4c493c3809da4bbcbbec0bf5ceb954e7410 which landed in Podman 3.1.0.

Comment 7 Tom Sweeney 2022-08-18 21:10:59 UTC
Assigning to Jindrich for any further packaging or BZ needs.

Comment 8 Jindrich Novy 2022-08-19 05:38:39 UTC
Matt, is there a plan to vendor this into v4.2-rhel maint branch of podman? Like this the fix could appear in 8.7/9.1.

Comment 9 Matthew Heon 2022-08-19 13:21:17 UTC
Can get that done on Monday, 8.7.0 should definitely be our target

Comment 10 Tom Sweeney 2022-08-19 14:12:32 UTC
Let's chat at scrum on Monday.  I definitely want this added to 8.7/9.1 and let's check with everyone else to see if there's anything else.

@lfriedma heads up.

Comment 11 Tom Sweeney 2022-08-19 18:47:06 UTC
FWIW, I've created the containers/common v0.49 release branch and have spun up a PR to include the commits that were added to the main branch before we cut v0.49.1 from main, which is the latest version in Podman v4.2.  That PR is: https://github.com/containers/common/pull/1126, but I'm having what I think are CI not setup properly issues and have Chris Evich to take a look.  Once that merges, we can backport Matt's PR from above into that release branch, cut v0.49.2 from there, then vendor that into Podman and spin up a v4.2.1.

Comment 26 errata-xmlrpc 2023-05-16 08:20:37 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: container-tools:rhel8 security, bug fix, and enhancement 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:2758