[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy |
Date: |
Fri, 9 Mar 2012 11:32:47 +0000 |
Hi,
I have a question about the libvirt SELinux policy that can be applied
to QEMU processes. Yesterday Laine helped Khoa and me diagnose an
issue where QEMU was doing fstatfs(2) but SELinux prevented this
FILESYSTEM__GETATTR operation, resulting in a failed syscall with
-EACCES. The SELinux hook is:
security/selinux/hooks.c:selinux_sb_statfs():
return superblock_has_perm(cred, dentry->d_sb,
FILESYSTEM__GETATTR, &ad);
It turns out this problem also affects XFS discard support in QEMU
today. QEMU calls platform_test_xfs_fd() in libxfs, which works like
this:
static __inline__ int platform_test_xfs_fd(int fd)
{
struct statfs buf;
if (fstatfs(fd, &buf) < 0)
return 0;
return (buf.f_type == 0x58465342); /* XFSB */
}
In other words, XFS detection will fail when SELinux is enabled.
I'm not familiar with libvirt's use of SELinux. Can someone explain
if we need to expand the policy in libvirt and how to do that?
Thanks,
Stefan
- [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy,
Stefan Hajnoczi <=
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Jiri Denemark, 2012/03/09
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Laine Stump, 2012/03/09
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Stefan Hajnoczi, 2012/03/09
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Stefan Hajnoczi, 2012/03/09
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Paolo Bonzini, 2012/03/09
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Stefan Hajnoczi, 2012/03/10
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Christoph Hellwig, 2012/03/24
- Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Christoph Hellwig, 2012/03/24
Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, George Wilson, 2012/03/09
Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy, Daniel P. Berrange, 2012/03/09