Re: [Qemu-devel] virtio-rng and fd passing

2013-03-05 Thread Amit Shah
On (Fri) 01 Mar 2013 [10:51:33], Paolo Bonzini wrote: > Il 01/03/2013 01:36, Eric Blake ha scritto: > > For fd passing to work, we have to use qemu_open() instead of raw > > open(). Is there any way to enforce that all files being opened by qemu > > go through the appropriate qemu_open() wrapper?

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread H. Peter Anvin
On 03/02/2013 04:23 AM, Paolo Bonzini wrote: > Il 02/03/2013 04:13, Anthony Liguori ha scritto: >> There is no valid use-case of rng-random other than using /dev/random. >> In fact, it was probably a mistake to even allow a filename to be >> specified because it lets people do silly things (like /d

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Eric Blake
On 03/04/2013 03:24 PM, Anthony Liguori wrote: >> Then libvirt should also make sure that the XML we allow for non-egd >> virtio-rng is restricted to the two filenames that won't cause a qemu >> warning, or even modify the XML to not expose a filename in the first >> place. We haven't released lib

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Anthony Liguori
Eric Blake writes: > [adding libvirt] > > On 03/03/2013 02:05 PM, Anthony Liguori wrote: >> Paolo Bonzini writes: >> >>> Il 02/03/2013 04:13, Anthony Liguori ha scritto: There is no valid use-case of rng-random other than using /dev/random. In fact, it was probably a mistake to even a

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Eric Blake
[adding libvirt] On 03/03/2013 02:05 PM, Anthony Liguori wrote: > Paolo Bonzini writes: > >> Il 02/03/2013 04:13, Anthony Liguori ha scritto: >>> There is no valid use-case of rng-random other than using /dev/random. >>> In fact, it was probably a mistake to even allow a filename to be >>> speci

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Eric Blake
On 03/01/2013 08:13 PM, Anthony Liguori wrote: > Eric Blake writes: > >> On 03/01/2013 04:59 PM, Anthony Liguori wrote: >>> I said this when seccomp was first introduced and I'll say it again. >>> blacklisting open() is a bad idea. DAC and MAC already exist and solve >>> this problem. We've got

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Corey Bryant
On 03/01/2013 10:34 PM, Stefan Berger wrote: On 03/01/2013 10:17 PM, Anthony Liguori wrote: Stefan Berger writes: On 03/01/2013 06:59 PM, Anthony Liguori wrote: Eric Blake writes: On 03/01/2013 04:05 PM, Anthony Liguori wrote: Eric Blake writes: On 03/01/2013 02:08 PM, Anthony Liguo

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Corey Bryant
On 03/04/2013 05:29 AM, Daniel P. Berrange wrote: On Fri, Mar 01, 2013 at 04:14:40PM -0700, Eric Blake wrote: I understand the reason that fdsets exist (because NFS is stupid and doesn't support labeling). But we aren't doing dynamic labeling of /dev/random and I strongly suspect it's not on

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-04 Thread Daniel P. Berrange
On Fri, Mar 01, 2013 at 04:14:40PM -0700, Eric Blake wrote: > > I understand the reason that fdsets exist (because NFS is stupid and > > doesn't support labeling). But we aren't doing dynamic labeling of > > /dev/random and I strongly suspect it's not on NFS anyway. > > > > So why are we trying t

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-03 Thread Amit Shah
On (Fri) 01 Mar 2013 [10:51:33], Paolo Bonzini wrote: > Il 01/03/2013 01:36, Eric Blake ha scritto: > > For fd passing to work, we have to use qemu_open() instead of raw > > open(). Is there any way to enforce that all files being opened by qemu > > go through the appropriate qemu_open() wrapper?

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-03 Thread Anthony Liguori
Stefan Berger writes: > It depends on what one defends against. If a jail-break succeeds and > open() is disabled, then that attack surfaces was effectively reduced. > It's hard to say whether opening files within libvirt could then allow > new exploits. Well, in the very least, libvirt is do

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-03 Thread Anthony Liguori
Paolo Bonzini writes: > Il 02/03/2013 04:13, Anthony Liguori ha scritto: >> There is no valid use-case of rng-random other than using /dev/random. >> In fact, it was probably a mistake to even allow a filename to be >> specified because it lets people do silly things (like /dev/urandom). >> >> I

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-02 Thread Paolo Bonzini
Il 02/03/2013 04:13, Anthony Liguori ha scritto: > There is no valid use-case of rng-random other than using /dev/random. > In fact, it was probably a mistake to even allow a filename to be > specified because it lets people do silly things (like /dev/urandom). > > If you want anything other than

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Stefan Berger
On 03/01/2013 10:17 PM, Anthony Liguori wrote: Stefan Berger writes: On 03/01/2013 06:59 PM, Anthony Liguori wrote: Eric Blake writes: On 03/01/2013 04:05 PM, Anthony Liguori wrote: Eric Blake writes: On 03/01/2013 02:08 PM, Anthony Liguori wrote: You can pass chardevs to the egd bac

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Stefan Berger writes: > On 03/01/2013 06:59 PM, Anthony Liguori wrote: >> Eric Blake writes: >> >>> On 03/01/2013 04:05 PM, Anthony Liguori wrote: Eric Blake writes: > On 03/01/2013 02:08 PM, Anthony Liguori wrote: > You can pass chardevs to the egd backend. It's rea

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Eric Blake writes: > On 03/01/2013 04:59 PM, Anthony Liguori wrote: >> I said this when seccomp was first introduced and I'll say it again. >> blacklisting open() is a bad idea. DAC and MAC already exist and solve >> this problem. We've got filesystem namespaces too. > > Let's explore that idea

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Stefan Berger
On 03/01/2013 06:59 PM, Anthony Liguori wrote: Eric Blake writes: On 03/01/2013 04:05 PM, Anthony Liguori wrote: Eric Blake writes: On 03/01/2013 02:08 PM, Anthony Liguori wrote: You can pass chardevs to the egd backend. It's really not a good idea to pass a fd via rng-rangom. Why not?

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Eric Blake
On 03/01/2013 04:59 PM, Anthony Liguori wrote: > I said this when seccomp was first introduced and I'll say it again. > blacklisting open() is a bad idea. DAC and MAC already exist and solve > this problem. We've got filesystem namespaces too. Let's explore that idea a bit further. What happens

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Eric Blake writes: > On 03/01/2013 04:05 PM, Anthony Liguori wrote: >> Eric Blake writes: >> >>> On 03/01/2013 02:08 PM, Anthony Liguori wrote: >>> >> You can pass chardevs to the egd backend. It's really not a good idea >> to pass a fd via rng-rangom. >>> >>> Why not? If you are runn

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Eric Blake
On 03/01/2013 04:05 PM, Anthony Liguori wrote: > Eric Blake writes: > >> On 03/01/2013 02:08 PM, Anthony Liguori wrote: >> > You can pass chardevs to the egd backend. It's really not a good idea > to pass a fd via rng-rangom. >> >> Why not? If you are running a single guest, why can't l

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Peter Krempa writes: > On 03/01/13 21:04, Anthony Liguori wrote: >> Eric Blake writes: >> >>> Stefan Berger and I discovered on IRC that virtio-rng is unable to >>> support fd passing. We attempted: >>> >>> qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom >>> -object rng-ra

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Eric Blake writes: > On 03/01/2013 02:08 PM, Anthony Liguori wrote: > You can pass chardevs to the egd backend. It's really not a good idea to pass a fd via rng-rangom. > > Why not? If you are running a single guest, why can't libvirt pass that > one guest an fd instead of making qemu

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Peter Krempa
On 03/01/13 21:04, Anthony Liguori wrote: Eric Blake writes: Stefan Berger and I discovered on IRC that virtio-rng is unable to support fd passing. We attempted: qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom -object rng-random,id=rng0,filename=/dev/fdset/4 -device vir

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Eric Blake
On 03/01/2013 02:08 PM, Anthony Liguori wrote: >>> You can pass chardevs to the egd backend. It's really not a good idea >>> to pass a fd via rng-rangom. Why not? If you are running a single guest, why can't libvirt pass that one guest an fd instead of making qemu open() the file? >> >> Fine,

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Stefan Berger writes: > On 03/01/2013 03:04 PM, Anthony Liguori wrote: >> Eric Blake writes: >> >>> Stefan Berger and I discovered on IRC that virtio-rng is unable to >>> support fd passing. We attempted: >>> >>> qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom >>> -object

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Paolo Bonzini
Il 01/03/2013 21:13, Stefan Berger ha scritto: > On 03/01/2013 02:37 PM, H. Peter Anvin wrote: >> On 02/28/2013 04:36 PM, Eric Blake wrote: >>> Stefan Berger and I discovered on IRC that virtio-rng is unable to >>> support fd passing. We attempted: >>> >>> qemu-system-x86_64 ... -add-fd >>> set=4,

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Stefan Berger
On 03/01/2013 03:04 PM, Anthony Liguori wrote: Eric Blake writes: Stefan Berger and I discovered on IRC that virtio-rng is unable to support fd passing. We attempted: qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom -object rng-random,id=rng0,filename=/dev/fdset/4 -devic

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread H. Peter Anvin
The guest kernel already provides the PRNG itself. We have been over this... Stefan Berger wrote: >On 03/01/2013 02:37 PM, H. Peter Anvin wrote: >> On 02/28/2013 04:36 PM, Eric Blake wrote: >>> Stefan Berger and I discovered on IRC that virtio-rng is unable to >>> support fd passing. We attemp

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Stefan Berger
On 03/01/2013 02:37 PM, H. Peter Anvin wrote: On 02/28/2013 04:36 PM, Eric Blake wrote: Stefan Berger and I discovered on IRC that virtio-rng is unable to support fd passing. We attempted: qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom ^

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Anthony Liguori
Eric Blake writes: > Stefan Berger and I discovered on IRC that virtio-rng is unable to > support fd passing. We attempted: > > qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom > -object rng-random,id=rng0,filename=/dev/fdset/4 -device > virtio-rng-pci,rng=rng0,bus=pci.0,add

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread H. Peter Anvin
On 02/28/2013 04:36 PM, Eric Blake wrote: > Stefan Berger and I discovered on IRC that virtio-rng is unable to > support fd passing. We attempted: > > qemu-system-x86_64 ... -add-fd > set=4,fd=34,opaque=RDONLY:/dev/urandom > -object rng-random,id=rng0,fil

Re: [Qemu-devel] virtio-rng and fd passing

2013-03-01 Thread Paolo Bonzini
Il 01/03/2013 01:36, Eric Blake ha scritto: > For fd passing to work, we have to use qemu_open() instead of raw > open(). Is there any way to enforce that all files being opened by qemu > go through the appropriate qemu_open() wrapper? > > Meanwhile, we have a quandary on the libvirt side of thin

[Qemu-devel] virtio-rng and fd passing

2013-02-28 Thread Eric Blake
Stefan Berger and I discovered on IRC that virtio-rng is unable to support fd passing. We attempted: qemu-system-x86_64 ... -add-fd set=4,fd=34,opaque=RDONLY:/dev/urandom -object rng-random,id=rng0,filename=/dev/fdset/4 -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x6 qemu-system-x86_64: -devi