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.

Bug 1663109

Summary: qemu-ga command guest-get-fsinfo isn't allowed read access
Product: Red Hat Enterprise Linux 7 Reporter: FuXiangChun <xfu>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: high    
Version: 7.7CC: chayang, juzhang, lvrabec, marcandre.lureau, mgrepl, michen, mmalik, plautrba, ssekidde, vmojzis, zpytela
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-04 08:17:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description FuXiangChun 2019-01-03 08:15:50 UTC
Description of problem:
when seliunx is enabled. guest-get-fsinfo command cann't get serial field content. It should be allowed by default.

Version-Release number of selected component (if applicable):
3.10.0-954.el7.x86_64
qemu-kvm-rhev-2.12.0-20.el7.x86_64
qemu-guest-agent-2.12.0-3.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.Boot guest with serial field

/usr/libexec/qemu-kvm -M pc -cpu Opteron_G4 -nodefaults -smp 4 -m 4G -name rhel7.5-pc -drive file=/home/rhel7.6-954-scsi.qcow2,id=drive0,if=none -device virtio-blk-pci,drive=drive0,serial=MYDISK-1 -drive file=empty.qcow2,id=drive1,if=none -device virtio-blk-pci,drive=drive1,serial=MYDISK-2 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x6 -chardev socket,id=charchannel1,server,nowait,path=qga.sock -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0 -vga qxl -monitor stdio -boot menu=on -vnc :2 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown -device virtio-net-pci,netdev=hostnet0,id=net0,mac=24:be:05:15:d1:90

2. without serial field.
# nc -U qga.sock
{"execute":"guest-get-fsinfo"}
{"return": [{"name": "vda1", "mountpoint": "/boot", "disk": [{"bus-type": "virtio", "bus": 0, "unit": 0, "pci-controller": {"bus": 0, "slot": 3, "domain": 0, "function": 0}, "dev": "/dev/vda1", "target": 0}], "type": "xfs"}, {"name": "dm-0", "mountpoint": "/", "disk": [{"bus-type": "virtio", "bus": 0, "unit": 0, "pci-controller": {"bus": 0, "slot": 3, "domain": 0, "function": 0}, "dev": "/dev/vda2", "target": 0}], "type": "xfs"}]}

3.Disabled selinux inside guest. can see serial field.
#setenforce 0

4.{"execute":"guest-get-fsinfo"}
{"return": [{"name": "vda1", "mountpoint": "/boot", "disk": [{"serial": "MYDISK-1", "bus-type": "virtio", "bus": 0, "unit": 0, "pci-controller": {"bus": 0, "slot": 3, "domain": 0, "function": 0}, "dev": "/dev/vda1", "target": 0}], "type": "xfs"}, {"name": "dm-0", "mountpoint": "/", "disk": [{"serial": "MYDISK-1", "bus-type": "virtio", "bus": 0, "unit": 0, "pci-controller": {"bus": 0, "slot": 3, "domain": 0, "function": 0}, "dev": "/dev/vda2", "target": 0}], "type": "xfs"}]}


Actual results:
selinux policy don't allow to read serial field.

Expected results:
works

Additional info:
refer to this comment.

https://bugzilla.redhat.com/show_bug.cgi?id=1635571#c20

Comment 2 Marc-Andre Lureau 2019-01-04 08:17:11 UTC

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