public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] main: test if gnome-remote-desktop-daemon can access TPM devices
@ 2026-11-18 7:20 Milos Malik
0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-11-18 7:20 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : main
Commit : 586d842e150b68b0e88e47e14b184390090ecd2f
Author : Milos Malik <mmalik@redhat.com>
Date : 2026-11-18T07:18:45+00:00
Stats : +21/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/586d842e150b68b0e88e47e14b184390090ecd2f?branch=main
Log:
test if gnome-remote-desktop-daemon can access TPM devices
Bug reports from our customers revealed that SELinux prevents the
gnome-remote-desktop-daemon process from accessing (syscall =
statx) the TPM devices (/dev/tpm0 and /dev/tpmrm0). The TC
reproduces the situation via a software TPM.
In order to support the scenario, I believe that SELinux policy
should allow the access. The TC looks for appropriate policy
rules and file context patterns.
The TC covers RHEL-138731.
---
diff --git a/selinux-policy/gnome-remote-desktop-and-similar/main.fmf b/selinux-policy/gnome-remote-desktop-and-similar/main.fmf
index 3b854a8..3f3541b 100644
--- a/selinux-policy/gnome-remote-desktop-and-similar/main.fmf
+++ b/selinux-policy/gnome-remote-desktop-and-similar/main.fmf
@@ -24,6 +24,9 @@ recommend:
- gnome-remote-desktop
- gdm
- freerdp
+ - tpm2-tools
+ - swtpm
+ - swtpm-tools
environment:
AVC_ERROR: +no_avc_check
duration: 10m
@@ -37,6 +40,7 @@ tag:
link:
- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2321236
- verifies: https://issues.redhat.com/browse/RHEL-35877
+ - verifies: https://redhat.atlassian.net/browse/RHEL-138731
adjust+:
- enabled: false
when: distro == rhel-4, rhel-5, rhel-6, rhel-7
diff --git a/selinux-policy/gnome-remote-desktop-and-similar/runtest.sh b/selinux-policy/gnome-remote-desktop-and-similar/runtest.sh
index 2349eb1..f3bcf01 100755
--- a/selinux-policy/gnome-remote-desktop-and-similar/runtest.sh
+++ b/selinux-policy/gnome-remote-desktop-and-similar/runtest.sh
@@ -69,10 +69,27 @@ rlJournalStart
rlSESearchRule "allow gnome_remote_desktop_t policykit_t : dbus { send_msg } [ ]"
rlSESearchRule "allow policykit_t gnome_remote_desktop_t : dbus { send_msg } [ ]"
rlPhaseEnd
+
+ rlPhaseStartTest "RHEL-138731"
+ rlSEMatchPathCon "/dev/tpm0" "tpm_device_t"
+ rlSEMatchPathCon "/dev/tpmrm0" "tpm_device_t"
+ rlSESearchRule "allow gnome_remote_desktop_t tpm_device_t : chr_file { getattr } [ ]"
+ rlPhaseEnd
fi
if [ -f /usr/lib/systemd/system/gnome-remote-desktop.service ] ; then
rlPhaseStartTest "real scenario"
+ rlRun "modprobe tpm_vtpm_proxy"
+ rlRun "lsmod | grep tpm"
+ rlRun "ls -lZ /dev/vtpmx"
+ rlRun "mkdir -p /var/lib/swtpm/tpm0"
+ rlRun "chown -R tss:tss /var/lib/swtpm"
+ rlRun "swtpm_setup --tpm-state /var/lib/swtpm/tpm0 --tpm2 --create-ek-cert --create-platform-cert"
+ rlRun "swtpm chardev --vtpm-proxy --tpm2 --tpmstate dir=/var/lib/swtpm/tpm0 --daemon"
+ sleep 2
+ rlRun "ls -lZ /dev/tpm*"
+ rlRun "tpm2_getrandom --hex 16"
+
rlRun "rm -rf ~gnome-remote-desktop/.local/share/gnome-remote-desktop"
rlRun "sudo -u gnome-remote-desktop mkdir -p ~gnome-remote-desktop/.local/share/gnome-remote-desktop"
rlRun "sudo -u gnome-remote-desktop winpr-makecert -silent -rdp -path ~gnome-remote-desktop/.local/share/gnome-remote-desktop tls"
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-18 7:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 7:20 [tests/selinux] main: test if gnome-remote-desktop-daemon can access TPM devices Milos Malik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox