Bug 826299 - SELinux is preventing /usr/bin/qemu-kvm from 'write' accesses on the blk_file sda1.
Summary: SELinux is preventing /usr/bin/qemu-kvm from 'write' accesses on the blk_file...
Keywords:
Status: CLOSED DUPLICATE of bug 755535
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 17
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:eba7878b1504046139ef10ac926...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-29 23:47 UTC by Ricardo Alves Teixeira
Modified: 2012-10-21 21:07 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
se
Clone Of:
Environment:
Last Closed: 2012-10-21 21:07:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ricardo Alves Teixeira 2012-05-29 23:47:15 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.7-1.fc17.x86_64
time:           Wed 30 May 2012 12:46:37 AM WEST

description:
:SELinux is preventing /usr/bin/qemu-kvm from 'write' accesses on the blk_file sda1.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that qemu-kvm should be allowed write access on the sda1 blk_file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep qemu-kvm /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:svirt_t:s0:c154,c176
:Target Context                system_u:object_r:virt_content_t:s0
:Target Objects                sda1 [ blk_file ]
:Source                        qemu-kvm
:Source Path                   /usr/bin/qemu-kvm
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           qemu-system-x86-1.0-17.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-125.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.7-1.fc17.x86_64 #1 SMP Mon
:                              May 21 22:32:19 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    Wed 30 May 2012 12:45:28 AM WEST
:Last Seen                     Wed 30 May 2012 12:45:28 AM WEST
:Local ID                      6675601d-ab49-482c-bc88-4017e2fad10b
:
:Raw Audit Messages
:type=AVC msg=audit(1338335128.295:229): avc:  denied  { write } for  pid=2595 comm="qemu-kvm" name="sda1" dev="devtmpfs" ino=51644 scontext=system_u:system_r:svirt_t:s0:c154,c176 tcontext=system_u:object_r:virt_content_t:s0 tclass=blk_file
:
:
:type=SYSCALL msg=audit(1338335128.295:229): arch=x86_64 syscall=open success=no exit=EACCES a0=7f78f5a33900 a1=81002 a2=0 a3=48 items=0 ppid=1 pid=2595 auid=4294967295 uid=107 gid=107 euid=107 suid=107 fsuid=107 egid=107 sgid=107 fsgid=107 tty=(none) ses=4294967295 comm=qemu-kvm exe=/usr/bin/qemu-kvm subj=system_u:system_r:svirt_t:s0:c154,c176 key=(null)
:
:Hash: qemu-kvm,svirt_t,virt_content_t,blk_file,write
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Miroslav Grepl 2012-05-30 08:31:54 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
se

Comment 2 Cole Robinson 2012-06-07 21:45:30 UTC
Miroslav, I assume that technical note piece was an accident. Can you explain what the issue is here? It claims the file is labeled virt_content_t so I don't understand the issue.

Comment 3 Daniel Walsh 2012-06-08 10:37:19 UTC
Content under /dev should never be labeled virt_content_t, it is not virt_content_t, it is either a fixed_disk_device_t or a removable_device_t. In this AVC it looks like libvirt relabeled the device sda1 to virt_content_t in stead of fixed_disk_device_t.  The avc is fine, since we do not want svirt_t able to write to virt_content_t.

Comment 4 Cole Robinson 2012-10-21 21:07:31 UTC
(In reply to comment #3)
> Content under /dev should never be labeled virt_content_t, it is not
> virt_content_t, it is either a fixed_disk_device_t or a removable_device_t.
> In this AVC it looks like libvirt relabeled the device sda1 to
> virt_content_t in stead of fixed_disk_device_t.  The avc is fine, since we
> do not want svirt_t able to write to virt_content_t.

There's another bug tracking similar issues with /dev/sr0, duping to that.

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


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