Bug 1716044 - SELinux is preventing dockerd-current from using the 'net_broadcast' capabilities.
Summary: SELinux is preventing dockerd-current from using the 'net_broadcast' capabili...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 30
Hardware: x86_64
OS: Unspecified
high
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:44c6270f4dc9af1fa736768a600...
: 1758633 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-01 09:49 UTC by Allan Poulsen
Modified: 2021-02-02 22:04 UTC (History)
12 users (show)

Fixed In Version: selinux-policy-3.14.3-52.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-17 01:13:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Allan Poulsen 2019-06-01 09:49:16 UTC
Description of problem:
Starting docker daemon
SELinux is preventing dockerd-current from using the 'net_broadcast' capabilities.

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

If you believe that dockerd-current should have the net_broadcast capability 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 'dockerd-current' --raw | audit2allow -M my-dockerdcurrent
# semodule -X 300 -i my-dockerdcurrent.pp

Additional Information:
Source Context                system_u:system_r:openvswitch_t:s0
Target Context                system_u:system_r:openvswitch_t:s0
Target Objects                Unknown [ capability ]
Source                        dockerd-current
Source Path                   dockerd-current
Port                          <Ukendt>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-37.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 5.0.17-300.fc30.x86_64 #1 SMP Mon
                              May 20 15:36:26 UTC 2019 x86_64 x86_64
Alert Count                   13
First Seen                    2019-05-30 22:06:01 CEST
Last Seen                     2019-05-31 21:20:25 CEST
Local ID                      0bc57d27-4910-441b-a328-dcea3b06d490

Raw Audit Messages
type=AVC msg=audit(1559330425.422:144): avc:  denied  { net_broadcast } for  pid=1849 comm="ovs-vswitchd" capability=11  scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=capability permissive=1


Hash: dockerd-current,openvswitch_t,openvswitch_t,capability,net_broadcast

Version-Release number of selected component:
selinux-policy-3.14.3-37.fc30.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.0.17-300.fc30.x86_64
type:           libreport

Comment 1 Allan Poulsen 2019-06-03 00:25:30 UTC
Description of problem:
Trying to start a docker container with an openvswitch instance active simultaneously

Version-Release number of selected component:
selinux-policy-3.14.3-37.fc30.noarch

Additional info:
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.1.5-300.fc30.x86_64
type:           libreport

Comment 2 Daniel Walsh 2019-06-03 05:56:44 UTC
This AVC looks like openvswitch was not run as a container, it was direcly launched or docker daemon is not running as contianer_runtime_t.

openvswitch_t is not a container label.

You would need to run the container with --security-opt label=disable and the process should be running as spc_t.

BTW Have you looked into Podman for running containers?

Comment 3 Jan Pazdziora 2019-06-11 12:51:51 UTC
In any case, running just

  dnf install -y /usr/lib/systemd/system/ovs-vswitchd.service
  systemctl start ovs-vswitchd.service

on Fedora 29 yields the same AVC denial. Is Open vSwitch really only supported in containers and not on Fedora host? This is a regression against Fedora 28.

Package versions are

openvswitch-2.10.0-3.fc29.x86_64
selinux-policy-3.14.2-59.fc29.noarch

Comment 5 Lukas Vrabec 2019-06-12 15:59:53 UTC
Hi All, 

I'm not aware that openvswitch is supported only in containers, but it sound very unlikely to me. The reason why openvswitch has net_broadcast capability in container is because of this boolean: virt_sandbox_use_all_caps turned on by default. On the other hand, I'm not sure if this is regression against Fedora 28, because this capability was not allowed on F28. 

Jan, 
Do we know which feature in openvswitch require net_broadcast capability? 

THanks,
Lukas.

Comment 6 Jan Pazdziora 2019-06-12 19:00:44 UTC
I have no idea. I merely install the package and start the service. This likely needs to be brought to the Open vSwitch's maintainers attention.

Comment 7 Lukas Vrabec 2019-06-14 20:47:03 UTC
Hi Openvswich folks, 

Is net_broadcast capability used by openvswitch in Fedora 29+ ? 

Feel free to move it back to selinux-policy component, after we find out if it make sense to allow in selinux-policy.

Thanks,
Lukas.

Comment 8 Aaron Conole 2019-09-30 13:27:26 UTC
It's needed - OvS needs to listen for certain multicast sockets that need this capability.

Comment 9 Lukas Vrabec 2019-10-02 10:46:54 UTC
commit 3b7467adffac219eb8ab24cabb0bfcbc61c566da (HEAD -> rawhide)
Author: Lukas Vrabec <lvrabec>
Date:   Wed Oct 2 12:46:39 2019 +0200

    Add net_broadcast capability to openvswitch_t domain BZ(1716044)

Comment 10 Fedora Update System 2019-10-04 13:36:33 UTC
FEDORA-2019-6bbf3d600d has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-6bbf3d600d

Comment 11 Lukas Vrabec 2019-10-04 16:35:13 UTC
*** Bug 1758633 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Update System 2019-10-04 22:15:04 UTC
selinux-policy-3.14.3-48.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-6bbf3d600d

Comment 13 Fedora Update System 2019-10-10 07:49:17 UTC
FEDORA-2019-6bbf3d600d has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-6bbf3d600d

Comment 14 Fedora Update System 2019-10-10 17:29:21 UTC
selinux-policy-3.14.3-49.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-6bbf3d600d

Comment 15 Fedora Update System 2019-10-23 07:00:41 UTC
FEDORA-2019-d68c9e27f8 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-d68c9e27f8

Comment 16 Fedora Update System 2019-10-25 19:34:14 UTC
selinux-policy-3.14.3-50.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-d68c9e27f8

Comment 17 Fedora Update System 2019-10-26 17:03:04 UTC
FEDORA-2019-f83217e2bf has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-f83217e2bf

Comment 18 Fedora Update System 2019-10-27 03:55:01 UTC
selinux-policy-3.14.3-51.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-f83217e2bf

Comment 19 Fedora Update System 2019-11-03 14:11:05 UTC
FEDORA-2019-70d80ad4bc has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-70d80ad4bc

Comment 20 Fedora Update System 2019-11-04 02:10:28 UTC
selinux-policy-3.14.3-52.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-70d80ad4bc

Comment 21 Fedora Update System 2019-11-17 01:13:27 UTC
selinux-policy-3.14.3-52.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.


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