Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Download KVM Guest Image from:
https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.4/x86_64/product-software
2.Place it in "/var/lib/libvirt/images/rhel-guest-image-8.4-992.x86_64.qcow2"
3. Create cidata.iso using the steps below:
# mkdir ci; cd ci
# vi meta-data
--8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------
instance-id: foobar
local-hostname: foobar.example.com
--8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------
# vi user-data
--8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------
#cloud-config
password: redhat
chpasswd: { expire: False }
ssh_pwauth: True
ssh_authorized_keys:
- <place_your_SSH_pubkey_here>
runcmd:
- su - -c date >~/testfile
--8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------
# mkisofs -o /var/lib/libvirt/images/cidata.iso -J -R -V cidata .
4. Create a new VM using rhel-guest-image-8.4-992.x86_64.qcow2 as disk drive and cidata.iso as a CD-ROM, boot it.
Actual results:
Extra 25 seconds delay with SELinux enabled and enforcing, AVC denial in audit.log as follows:
type=USER_AVC msg=audit(1633097673.446:66): pid=652 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc: denied { send_msg } for msgtype=method_return dest=:1.19 spid=723 tpid=1434 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:cloud_init_t:s0 tclass=dbus permissive=0 exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'UID="dbus" AUID="unset" SAUID="dbus"
Expected results:
No AVC, no extra delay.
Additional info:
https://access.redhat.com/solutions/5692661
Suggests:
--8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------
policy_module(cloud_init_sudo, 1.0)
gen_require(`
type cloud_init_t;
type systemd_logind_t;
class dbus send_msg;
')
allow systemd_logind_t cloud_init_t:dbus send_msg;
allow cloud_init_t systemd_logind_t:dbus send_msg;
--8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------
Hi Stepan,
please can you reproduce the scenario again and attach here full AVC's messages in permissive mode?
Steps to enable full auditing and permissive SELinux mode:
1) Open the /etc/audit/rules.d/audit.rules file in an editor.
2) Remove the following line if it exists:
-a task,never
3) Add the following line to the end of the file:
-w /etc/shadow -p w
4) Restart the audit daemon:
# service auditd restart
5) Open the /etc/selinux/config file in an editor.
change line
SELINUX=enforcing
to
SELINUX=permissive
6) Re-run your scenario
7) Collect AVC denials:
# ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts today
Thank you,
Patrik
Unfortunately the reproducer uses a vanilla guest image, as taken from the customer portal, that I am unable to modify. (guestfish fails to mount the image read-write)
cloud-init does not run the second time post-install, I believe.
I cannot provide the data you requested.
(In reply to Stepan Broz from comment #2)
> Unfortunately the reproducer uses a vanilla guest image, as taken from the
> customer portal, that I am unable to modify. (guestfish fails to mount the
> image read-write)
> cloud-init does not run the second time post-install, I believe.
>
> I cannot provide the data you requested.
Stepane,
The new policy build is on the way, we will however hardly be able to test a complex scenario similar enough to the customer's environment, so there is a risk the fix is not complete. Do you think they will be able to test the selinux-policy package?
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (selinux-policy bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2022:1995
Description of problem: Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Download KVM Guest Image from: https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.4/x86_64/product-software 2.Place it in "/var/lib/libvirt/images/rhel-guest-image-8.4-992.x86_64.qcow2" 3. Create cidata.iso using the steps below: # mkdir ci; cd ci # vi meta-data --8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------ instance-id: foobar local-hostname: foobar.example.com --8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------ # vi user-data --8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------ #cloud-config password: redhat chpasswd: { expire: False } ssh_pwauth: True ssh_authorized_keys: - <place_your_SSH_pubkey_here> runcmd: - su - -c date >~/testfile --8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------ # mkisofs -o /var/lib/libvirt/images/cidata.iso -J -R -V cidata . 4. Create a new VM using rhel-guest-image-8.4-992.x86_64.qcow2 as disk drive and cidata.iso as a CD-ROM, boot it. Actual results: Extra 25 seconds delay with SELinux enabled and enforcing, AVC denial in audit.log as follows: type=USER_AVC msg=audit(1633097673.446:66): pid=652 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc: denied { send_msg } for msgtype=method_return dest=:1.19 spid=723 tpid=1434 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:cloud_init_t:s0 tclass=dbus permissive=0 exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'UID="dbus" AUID="unset" SAUID="dbus" Expected results: No AVC, no extra delay. Additional info: https://access.redhat.com/solutions/5692661 Suggests: --8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------ policy_module(cloud_init_sudo, 1.0) gen_require(` type cloud_init_t; type systemd_logind_t; class dbus send_msg; ') allow systemd_logind_t cloud_init_t:dbus send_msg; allow cloud_init_t systemd_logind_t:dbus send_msg; --8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<------