Bug 2095097

Summary: [RFE] Podman copying the entries of /etc/hosts in the container
Product: Red Hat Enterprise Linux 8 Reporter: Faraz Sayyed <fsayyed>
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: Yuhui Jiang <yujiang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.6CC: arajendr, bbaude, dornelas, dwalsh, dwojewod, jligon, jnovy, lsm5, mheon, pthomas, tsweeney, umohnani, ypu
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: podman-4.1.0-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:16:27 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:

Description Faraz Sayyed 2022-06-09 02:32:22 UTC
Description of problem:

Podman leaking the entries of /etc/hosts from the host to the containers.

Version-Release number of selected component (if applicable):

podman-4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64

How reproducible:

Always

Steps to Reproduce:

1. podman run -it --rm ubi8:latest cat /etc/hosts

Actual results:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.88.0.36	6b34a9129a7e unruffled_gagarin
10.88.0.1 host.containers.internal

Additional info:

There is a new option base_hosts_file="none" that can be added to the container.conf file which can prevent the podman from copying the contents of /etc/hosts from the host to the container. But this option will only work with podman version 4.1. Can we backport this feature to podman version 4.0?

Please refer to the below upstream link for reference:

https://github.com/containers/podman/issues/14253

Comment 3 Tom Sweeney 2022-06-09 17:16:06 UTC
@dornelas This was fixed in containers/common with this PR:  https://github.com/containers/common/pull/998, which was merged on April 21, 2022 which made it into c/common v0.48.0.  That version of c/common was spun up on May 2, 2022, and is in upstream Podman and also the v4.1 release branch. The v4.1 release branch is where the Podman v4.1.1 will be spun for RHEL 8.6.0.2.

Given All that, I'm going to set this to POST and will assign to Jindrich for any further BZ/packaging needs.

Comment 4 Derrick Ornelas 2022-06-09 17:18:35 UTC
Thanks for the confirmation.

Comment 15 errata-xmlrpc 2022-11-08 09:16:27 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-2022:7457

Comment 16 Red Hat Bugzilla 2023-09-18 04:38:55 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days