Bug 1550159 - AVC denial about xtables.lock when starting kube-proxy and kubelet
Summary: AVC denial about xtables.lock when starting kube-proxy and kubelet
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: docker
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-28 16:37 UTC by Jan Pazdziora
Modified: 2018-12-13 12:41 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 22:06:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2018-02-28 16:37:03 UTC
Description of problem:

When starting kube-proxy and kubelet on Kubernetes node, AVC denial gets logged.

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

kubernetes-node-1.9.1-5.fc27.x86_64
selinux-policy-3.13.1-283.17.fc27.noarch
iptables-1.6.1-4.fc27.x86_64
docker-1.13.1-44.git584d391.fc27.x86_64
container-selinux-2.48-1.fc27.noarch

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf install -y kubernetes-node
2. systemctl restart kube-proxy kubelet
3. Check audit.log / journal.

Actual results:

type=AVC msg=audit(1519835116.383:147): avc:  denied  { read } for  pid=11978 comm="iptables" name="xtables.lock" dev="tmpfs" ino=36434 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1519835116.386:148): avc:  denied  { read } for  pid=11980 comm="iptables" name="xtables.lock" dev="tmpfs" ino=36434 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1519835116.387:149): avc:  denied  { read } for  pid=11981 comm="iptables" name="xtables.lock" dev="tmpfs" ino=36434 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1519835116.388:150): avc:  denied  { read } for  pid=11982 comm="iptables" name="xtables.lock" dev="tmpfs" ino=36434 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1519835116.389:151): avc:  denied  { read } for  pid=11983 comm="iptables" name="xtables.lock" dev="tmpfs" ino=36434 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1519835116.390:152): avc:  denied  { read } for  pid=11984 comm="iptables" name="xtables.lock" dev="tmpfs" ino=36434 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0

Expected results:

No AVC denials logged.

Additional info:

This is very similar to bug 1391039.

The file /var/run/xtables.lock looks mislabelled.

# restorecon -nv /var/run/xtables.lock
Would relabel /run/xtables.lock from system_u:object_r:var_run_t:s0 to system_u:object_r:iptables_var_run_t:s0

Comment 1 Jan Pazdziora 2018-02-28 16:48:45 UTC
The same bug is also present on Fedora 26 with

kubernetes-node-1.7.3-1.fc26.x86_64
selinux-policy-3.13.1-260.18.fc26.noarch
iptables-1.6.1-2.fc26.x86_64
docker-1.13.1-44.git584d391.fc26.x86_64
container-selinux-2.40-1.fc26.noarch

Comment 3 Jan Pazdziora 2018-02-28 16:59:22 UTC
Starting only the kubelet or only the kube-proxy does not seem to trigger the error.

Comment 4 Jan Pazdziora 2018-05-18 10:06:13 UTC
The issue is still present on Fedora 27 with latest Kubernetes:

kubernetes-node-1.10.1-0.fc27.x86_64
selinux-policy-3.13.1-283.34.fc27.noarch
iptables-1.6.2-3.fc27.x86_64
docker-1.13.1-51.git4032bd5.fc27.x86_64
container-selinux-2.55-1.fc27.noarch

Comment 5 Jan Chaloupka 2018-05-18 10:11:10 UTC
Selinux related issues were always handled by the docker team. If not, please reassign back or to the proper component. Thanks.

Comment 6 Jan Pazdziora 2018-05-18 10:14:00 UTC
The thing is, merely starting docker on fresh Fedora 27 install works.

It's when Kubernetes get added to the mix and they create that mislabeled /run/xtables.lock file, then things start to fail.

Comment 7 Jan Pazdziora 2018-05-21 07:40:21 UTC
A workaround is to run

touch /run/xtables.lock

before installing (starting?) Kubernetes.

Comment 8 Jan Pazdziora 2018-07-02 15:06:59 UTC
With the recent packages

kubernetes-node-1.10.1-0.fc27.x86_64
selinux-policy-3.13.1-283.34.fc27.noarch
iptables-1.6.2-3.fc27.x86_64
docker-1.13.1-59.gitaf6b32b.fc27.x86_64
container-selinux-2.65-1.gitbf5b26b.fc27.noarch

on Fedora 27, the systemctl restart kube-proxy kubelet not just produces AVC denial but kubelet.service fails to start altogether.

Comment 10 Ben Cotton 2018-11-27 15:03:35 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Ben Cotton 2018-11-30 22:06:46 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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