Bug 1391039 - SELinux is preventing iptables from 'read' accesses on the file xtables.lock.
Summary: SELinux is preventing iptables from 'read' accesses on the file xtables.lock.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:155cd984ca7ac90cae8e56ce625...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-02 13:03 UTC by Wolfgang Rupprecht
Modified: 2017-03-26 17:48 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-02 13:52:54 UTC
Type: ---


Attachments (Terms of Use)

Description Wolfgang Rupprecht 2016-11-02 13:03:34 UTC
Description of problem:
systemctl restart iptables
SELinux is preventing iptables from 'read' accesses on the file xtables.lock.

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

If you believe that iptables 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 -X 300 -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                   iptables
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-220.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.8.5-300.fc25.x86_64 #1 SMP Fri
                              Oct 28 21:43:58 UTC 2016 x86_64 x86_64
Alert Count                   6
First Seen                    2016-11-02 06:00:30 PDT
Last Seen                     2016-11-02 06:00:30 PDT
Local ID                      26368ee0-8ff8-4adc-804f-1eb0bb6b2075

Raw Audit Messages
type=AVC msg=audit(1478091630.701:834): avc:  denied  { read } for  pid=1299 comm="iptables" name="xtables.lock" dev="tmpfs" ino=19348 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0


Hash: iptables,iptables_t,var_run_t,file,read

Version-Release number of selected component:
selinux-policy-3.13.1-220.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.5-300.fc25.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2016-11-02 13:52:54 UTC
It looks fixed on my system. 
Could you run restorecon:

# restorecon -v /var/run/xtables.lock

If you catch this issue again, please re-open BZ.

Comment 2 Wolfgang Rupprecht 2016-11-02 18:55:10 UTC
# restorecon -v /var/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

Might the problem be timing related.  The first time I ran it (when it failed) it had updated the ipv4 iptables but left the ipv6 tables cleared with no filter chains loaded.   I ran it again after sending the bug report (in preparation for a reboot if it failed again).   This time it ran without incident.

Comment 3 Wolfgang Rupprecht 2016-11-26 15:57:07 UTC
Description of problem:
This happened during normal operation

Version-Release number of selected component:
selinux-policy-3.13.1-224.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.8-300.fc25.x86_64
type:           libreport

Comment 4 Wolfgang Rupprecht 2017-03-26 17:48:18 UTC
Description of problem:
This occured during normal unattended operation.

Version-Release number of selected component:
selinux-policy-3.13.1-225.6.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.9.14-200.fc25.x86_64
type:           libreport


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