From: Laine Stump <laine@laine.org>
To: Stefan Hajnoczi <stefanha@gmail.com>,
libvir-list@redhat.com, qemu-devel <qemu-devel@nongnu.org>,
Khoa Huynh <khoa@us.ibm.com>, George Wilson <gcwilson@us.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy
Date: Fri, 09 Mar 2012 10:11:55 -0500 [thread overview]
Message-ID: <4F5A1DBB.3030606@laine.org> (raw)
In-Reply-To: <20120309141653.GH4883@orkuz.home>
On 03/09/2012 09:16 AM, Jiri Denemark wrote:
> Hi.
>
> On Fri, Mar 09, 2012 at 11:32:47 +0000, Stefan Hajnoczi wrote:
> ...
>> 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?
> Actually, there is no SELinux policy in libvirt. Libvirt merely uses an
> appropriate security context when running qemu processes. The rules what such
> processes can do and what they are forbidden to do are described in SELinux
> policy which is provided as a separate package (or packages on some distros).
> So it's this policy (selinux-policy package on Fedora based distros) which
> would need to be expanded. Thus it should be negotiated with SELinux policy
> maintainers if they are willing to allow svirt_t domain calling fstatfs.
(Also, since the problem occurs on NFS, this may need to be somehow
related to virt_use_nfs being turned on.)
As far as I understand from the conversation yesterday, this use of
fstatfs was added into qemu as part of a "hack" to improve performance
of guests whose images were on NFS shares. This was a problem in
RHEL6.1, for example. The lower level problems that caused poor
performance of images on NFS and necessitated this problem have been
fixed and, for example, are already in RHEL6.2, so the code is in the
process of being removed from QEMU.
So am I correct that this extra permission is only needed for a single
RHEL6 release? If qemu won't be doing fstafs on an ongoing basis, it
doesn't seem like a good idea to permanently open up the permissions
allowed by virt_use_nfs
next prev parent reply other threads:[~2012-03-09 15:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 11:32 [Qemu-devel] QEMU fstatfs(2) and libvirt SELinux policy Stefan Hajnoczi
2012-03-09 14:16 ` Jiri Denemark
2012-03-09 15:11 ` Laine Stump [this message]
2012-03-09 15:19 ` Stefan Hajnoczi
2012-03-09 16:07 ` Stefan Hajnoczi
2012-03-09 17:16 ` Paolo Bonzini
2012-03-10 7:30 ` Stefan Hajnoczi
2012-03-24 14:47 ` Christoph Hellwig
2012-03-24 14:46 ` Christoph Hellwig
2012-03-09 15:23 ` George Wilson
2012-03-09 16:08 ` Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F5A1DBB.3030606@laine.org \
--to=laine@laine.org \
--cc=gcwilson@us.ibm.com \
--cc=khoa@us.ibm.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.