I see that there's a virt_use_rawip boolean nowadays. Is rawip sufficiently dangerous that we can't just allow it by default?
usermode networking aka slirp uses rawip for ping AIUI. boxes uses usermode networking by default.

Basically anything that allows a confined domain to look at rawouput from the ethernet device or able to generate rawip trafic is going to be blocked, if we could get a separate app that qemu could execute which we allowed rawip, like ping or something, that might solve the problem. I don't know what access you are trying to implement.
I have added Eric Paris and Paul Moore to the CC to see if they have opinions.

> We can change QEMU to use IPPROTO_ICMP.
>
> Would IPPROTO_ICMP be also powerful enough that we cannot enable it by
> default? And/or would it need a separate boolean?
What is QEMU using these sockets for ?

Looking quickly at the upstream QEMU sources, there appears to be a socket() call in slirp/ip_icmp.c which could be the source of this AVC:
81: so->s = qemu_socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);
In this case qemu_socket(...) is defined in util/osdep.c and is a simple wrapper to socket().
With the current SELinux code, any socket created as AF_INET[6] SOCK_DGRAM socket that is created with a non-default protocol (IPPROTO_ICMP is not the default protocol for SOCK_DGRAM) will appear as a rawip_socket in SELinux.
I suspect the AVC is the result of the people running QEMU with the usermode networking stack.

Although libguestfs allows people to enable SLIRP in qemu, it's
not the default and is fairly unusual. Also we wouldn't expect
ICMP to work in any case, because libguestfs normally runs as
non-root. (ie. only TCP connections and the like are expected
to work).

> With the current SELinux code, any socket created as AF_INET[6] SOCK_DGRAM
> socket that is created with a non-default protocol (IPPROTO_ICMP is not the
> default protocol for SOCK_DGRAM) will appear as a rawip_socket in SELinux.
Ok, that explains it.

So the question then is what to do with this bug? Is it a bug in the kernel? qemu? Or do we just go with the boolean.
F18 has
#============= svirt_t ==============
#!!!! This avc can be allowed using the boolean 'virt_use_rawip'
allow svirt_t self:rawip_socket create;

(In reply to comment #13)
> Is it a bug in the kernel?
No. At least I don't consider it a bug.
> qemu?
No. QEMU is a bit "odd" as far as applications go in that it does unusual things; this is just one case of its unusual behavior.
> Or do we just go with the boolean.
That seems reasonable to me. Perhaps we can make setroubleshoot more intelligent about this particular AVC?

F18 setroubleshoot would say.
***** Plugin catchall_boolean (89.3 confidence) suggests *******************
If you want to allow confined virtual guests to interact with rawip sockets
Then you must tell SELinux about this by enabling the 'virt_use_rawip' boolean.
You can read 'virt_selinux' man page for more details.
Do
setsebool -P virt_use_rawip 1

As long as the virt_selinux manpage makes some reference to usermode networking in conjunction with the virt_use_rawip boolean I think we are okay. Unfortunately I just checked the virt_selinux manpage on my Rawhide system and didn't see any reference of the virt_use_rawip boolean.

This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Note

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