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 1436904 - iptables cannot access /run/xtables.lock
Summary: iptables cannot access /run/xtables.lock
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-29 01:11 UTC by Steven Haigh
Modified: 2020-08-05 20:43 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-3.13.1-141
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-10 15:29:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
systemd service to reset the permissions on xtables.lock (867 bytes, text/plain)
2020-08-05 20:43 UTC, James E.
no flags Details

Description Steven Haigh 2017-03-29 01:11:03 UTC
SELinux is preventing /usr/sbin/xtables-multi from read access on the file xtables.lock.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that xtables-multi should be allowed read access on the xtables.lock file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'iptables' --raw | audit2allow -M my-iptables
# semodule -i my-iptables.pp


Additional Information:
Source Context                system_u:system_r:iptables_t:s0
Target Context                system_u:object_r:var_run_t:s0
Target Objects                xtables.lock [ file ]
Source                        iptables
Source Path                   /usr/sbin/xtables-multi
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages           iptables-1.4.21-17.el7.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-102.el7_3.15.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     spin-gw.crc.id.au
Platform                      Linux spin-gw.crc.id.au 4.9.18-1.el7xen.x86_64 #1
                              SMP Mon Mar 27 00:30:03 AEDT 2017 x86_64 x86_64
Alert Count                   35
First Seen                    2017-03-28 23:41:32 AEDT
Last Seen                     2017-03-28 23:42:37 AEDT
Local ID                      89dcf827-b6d2-4024-80fd-83c3ecea55df

Raw Audit Messages
type=AVC msg=audit(1490704957.914:374): avc:  denied  { read } for  pid=2743 comm="ip6tables" name="xtables.lock" dev="tmpfs" ino=15464 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0


type=SYSCALL msg=audit(1490704957.914:374): arch=x86_64 syscall=open success=no exit=EACCES a0=412a7b a1=40 a2=180 a3=7ffe2f7c4ef0 items=0 ppid=2667 pid=2743 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ip6tables exe=/usr/sbin/xtables-multi subj=system_u:system_r:iptables_t:s0 key=(null)

Hash: iptables,iptables_t,var_run_t,file,read

Comment 2 Steven Haigh 2017-03-29 01:13:35 UTC
Interestingly, the following resets fine and removes the error until the next boot:

$ restorecon -v /run/xtables.lock
restorecon reset /run/xtables.lock context system_u:object_r:var_run_t:s0->system_u:object_r:iptables_var_run_t:s0

Could it be a priority issue where we match var_run_t instead of iptables_var_run_t on file creation?

Comment 3 Milos Malik 2017-03-29 06:16:50 UTC
I believe this bug is a duplicate of BZ#1376343. Unfortunately, this bug is not fixed in any RHEL-7.3.z.

Comment 4 Steven Haigh 2017-03-29 06:18:14 UTC
I can't assist there:
You are not authorized to access bug #1376343.

Comment 5 Steven Haigh 2017-03-29 06:31:14 UTC
After reviewing, this does seem to be the same problem.

Happy to mark as duplicate and close this if you wish?

Comment 6 James E. 2020-07-10 17:19:17 UTC
This doesn't seem to have been fixed yet. I'm experiencing it on selinux-policy-3.13.1-266.el7 on RHEL 7.7.

Also, nobody in our company can access the bug this has been listed as a "duplicate" of.

Comment 7 James E. 2020-08-05 20:43:10 UTC
Created attachment 1710572 [details]
systemd service to reset the permissions on xtables.lock

This fixed it for our systems, where we deduced it's a McAfee x SELinux bug that impacts iptables.


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