Bug 1216903 - SELinux: policy update broke kvm network autostart
Summary: SELinux: policy update broke kvm network autostart
Status: VERIFIED FIXED
: 1216870 1217470 (view as bug list)
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Security (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Major (vote)
Target Milestone: ---
Assignee: Cathy Hu
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 10:33 UTC by Robert Frohl
Modified: 2024-06-06 10:40 UTC (History)
8 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: Yes
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Frohl 2023-11-06 10:33:24 UTC
Hi,

since the update to selinux-policy: 20231030 KVM network autostart/interaction is broken. If one tries to start the network manually in virsh the following error is observed:

> virsh # net-start default
> error: Failed to start network default
> error: internal error: Failed to apply firewall rules /sbin/iptables -w --table filter --list-rules: libvirt:  error : cannot execute binary /sbin/iptables: Permission denied

with 

> virsh # net-info default
> Name:           default
> UUID:           31f53528-0578-4d70-b510-2f50fcf424f0
> Active:         no
> Persistent:     yes
> Autostart:      yes
> Bridge:         virbr0

As a workaround I am using:

> # setenforce 0
> # virsh net-start default
> # setenforce 1

There is only one detail to be observed: if virsh is run before 'setenforce 0', then the above does not work until the system is restarted. 

More details: it is not even 'needed' to net-start, any virsh command will trigger the autostart if 'setenforce 0' was issued.
Comment 2 Robert Frohl 2023-11-06 10:41:28 UTC
not 100% sure if the policy is at vault or something changed while the policy was updated. Issue was observed before the newest libvirt release (i.e. 20231103 -> libvirt 9.9.0)
Comment 3 Robert Frohl 2023-11-06 10:47:15 UTC
community spotted the issue first: https://forums.opensuse.org/t/latest-update-in-microos-results-in-kvm-failure-to-start-network/170280
Comment 4 Filippo Bonazzi 2023-11-06 12:44:59 UTC
Seems to be multiple issues on top of each other.

The first seems to have to do with the io_uring changes introduced in kernel.if.

Then there seem to be some changes introduced in the virt policy module refactoring (https://github.com/fedora-selinux/selinux-policy/pull/1754). Being new it could be that there are some teething issues upstream as well, or it could be that they are specific to our environment.
Comment 5 Filippo Bonazzi 2023-11-06 13:08:29 UTC
The io_uring issue has been reported and is being worked on upstream: https://bugzilla.redhat.com/show_bug.cgi?id=2245233
Comment 6 Santiago Zarate 2023-11-19 20:45:03 UTC
if it helps, restarting associated services, and then restarting manually the networks (libvirt ones) is another workaround... I guess that won't scale on production systems though :)
Comment 9 Cathy Hu 2023-11-24 08:43:41 UTC
*** Bug 1216870 has been marked as a duplicate of this bug. ***
Comment 10 Cathy Hu 2023-11-24 08:44:13 UTC
*** Bug 1217470 has been marked as a duplicate of this bug. ***
Comment 11 Cathy Hu 2023-11-24 10:02:31 UTC
Update to factory is in the queue: https://build.opensuse.org/request/show/1128521

Changes are already in the staging project, in case it is super urgent you can test it with that one:
https://build.opensuse.org/package/show/security:SELinux/selinux-policy
Comment 12 Cathy Hu 2023-11-27 14:08:42 UTC
Fix is upstream, please reopen if you still encounter the issue. Thanks!
Comment 13 Cathy Hu 2023-11-27 14:09:42 UTC
sorry, s/upstream/in factory
Comment 14 Santiago Zarate 2023-11-27 22:18:12 UTC
Thanks a lot Cathy! works on my affected servers machine now!...
Comment 15 Cathy Hu 2024-03-13 11:08:41 UTC
just a heads up, I am currently reworking the fix. 
it is in security:SELinux in case someone wants to test it, will submit to factory this week. 

please let me know in case anything breaks (i tested locally, but for all eventualities :))
Comment 16 OBSbugzilla Bot 2024-03-13 17:35:01 UTC
This is an autogenerated message for OBS integration:
This bug (1216903) was mentioned in
https://build.opensuse.org/request/show/1157662 Factory / selinux-policy