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.
Bug 1738845 - selinux policy don't allow guest-fsfreeze-freeze command to freeze 'data disk mount point'
Summary: selinux policy don't allow guest-fsfreeze-freeze command to freeze 'data disk...
Keywords:
Status: CLOSED DUPLICATE of bug 1747960
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.2
Assignee: Lukas Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1778780
TreeView+ depends on / blocked
 
Reported: 2019-08-08 09:28 UTC by FuXiangChun
Modified: 2021-10-07 12:05 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-03 19:07:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description FuXiangChun 2019-08-08 09:28:40 UTC
Description of problem:
Boot RHEL8.1 guest with 2 disks. one is system disk. another is data disk. Then disk format data disk and mount it to /mnt. Sent guest-fsfreeze-freeze to freeze guest file system. But return a error"{"error": {"class": "GenericError", "desc": "failed to open /mnt: Permission denied"}}"

If disable selinux inside guest. It works well.

Version-Release number of selected component (if applicable):
4.18.0-120.el8.x86_64
qemu-guest-agent-4.0.0-5.module+el8.1.0+3622+5812d9bf.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot a RHEL8.1 guest with 2 disks

/usr/libexec/qemu-kvm -name avocado-vt-vm1 -machine pc -nodefaults -device VGA,bus=pci.0,addr=0x2 -device virtio-serial-pci,id=virtio-serial1,max_ports=31 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,bus=virtio-serial1.0,chardev=channel2,name=org.qemu.guest_agent.0 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x5 -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/kvm_autotest_root/images/rhel810-64-virtio-scsi.qcow2 -device scsi-hd,id=image1,drive=drive_image1 -drive file=/home/data-disk.qcow2,id=data-disk,if=none,snapshot=off,aio=threads,cache=none,format=qcow2 -device virtio-blk-pci,drive=data-disk,id=data-disk1 -m 14336 -smp 12,maxcpus=12,cores=6,threads=1,sockets=2 -cpu Haswell-noTSX,+kvm_pv_unhalt -vnc :0 -rtc base=utc,clock=host,driftfix=slew -boot order=cdn,once=c,menu=off,strict=off -enable-kvm -monitor stdio

2. format data disk and mount it to /mnt
#mkfs /dev/vda
#mount /dev/vda /mnt

3.# nc -U /tmp/helloworld2
{"execute": "guest-fsfreeze-status"}
{"return": "thawed"}
{"execute": "guest-fsfreeze-freeze"}

Actual results:
{"error": {"class": "GenericError", "desc": "failed to open /mnt: Permission denied"}}

Expected results:
works

Additional info:
disable selinux inside guest, it works.

# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today
----
type=PROCTITLE msg=audit(08/08/2019 17:16:06.257:111) : proctitle=/usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=,,,,,,,-status -F/etc/qemu-g 
type=SYSCALL msg=audit(08/08/2019 17:16:06.257:111) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x555d2daa7040 a2=O_RDONLY|O_CLOEXEC a3=0x0 items=0 ppid=1 pid=1610 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=qemu-ga exe=/usr/bin/qemu-ga subj=system_u:system_r:virt_qemu_ga_t:s0 key=(null) 
type=AVC msg=audit(08/08/2019 17:16:06.257:111) : avc:  denied  { read } for  pid=1610 comm=qemu-ga name=/ dev="vda" ino=128 scontext=system_u:system_r:virt_qemu_ga_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0 
----
type=PROCTITLE msg=audit(08/08/2019 17:16:06.257:112) : proctitle=/usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=,,,,,,,-status -F/etc/qemu-g 
type=SYSCALL msg=audit(08/08/2019 17:16:06.257:112) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x555d2daa6d40 a2=O_RDONLY|O_CLOEXEC a3=0x0 items=0 ppid=1 pid=1610 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=qemu-ga exe=/usr/bin/qemu-ga subj=system_u:system_r:virt_qemu_ga_t:s0 key=(null) 
type=AVC msg=audit(08/08/2019 17:16:06.257:112) : avc:  denied  { read } for  pid=1610 comm=qemu-ga name=/ dev="vda" ino=128 scontext=system_u:system_r:virt_qemu_ga_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0

Comment 1 Lukas Vrabec 2019-09-03 19:07:22 UTC

*** This bug has been marked as a duplicate of bug 1747960 ***


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