Skip to content

Commit 1fd93fc

Browse files
committed
vmupdate: disable SELinux during update
Apparently some packages (chromium) may load half-assembled SELinux policy during the update. Later in the update process the policy gets rebuilt and loaded again, so after the update all should be fine. But if the update gets interrupted by such half-installed policy, it won't work. Workaround the issue by disabling SELinux before the update. It will get enabled again the next time VM starts. Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2380156 Fixes QubesOS/qubes-issues#10054 Fixes QubesOS/qubes-issues#9663
1 parent 48f61f2 commit 1fd93fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vmupdate/agent/source/plugins/fix_meminfo_writer_label.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def fix_meminfo_writer_label(os_data, log, **kwargs):
3232
f"SELinux label for {meminfo_path} changed to '{expected_label}'"
3333
)
3434
label_changed = True
35+
# Disable SELinux for the update time, to avoid
36+
# half-updated policy interrupting the process. This is
37+
# workaround for
38+
# https://bugzilla.redhat.com/show_bug.cgi?id=2380156
39+
subprocess.check_call(["setenforce", "0"])
3540
except subprocess.CalledProcessError as e:
3641
log.error(f"Error processing {meminfo_path}: {e}")
3742

0 commit comments

Comments
 (0)