Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-12 Thread Paolo Bonzini
Il 12/09/2012 10:05, James Bottomley ha scritto: > This is why the whole filter thing was mutable via sysfs. That way the > admin could set this up per device. It sounds like this is what you > want to fix, rather than opening up more holes in an already leaky > security apparatus. It is, thanks

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-12 Thread James Bottomley
On Tue, 2012-09-11 at 19:56 +0200, Paolo Bonzini wrote: > The set of use cases is so variable that no single filter can accomodate > all of them: high availability people want persistent reservations, NAS > people want trim/discard, but these are just two groups. Someone is > using a Windows VM to

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Tejun Heo
Hello, On Tue, Sep 11, 2012 at 3:10 PM, Paolo Bonzini wrote: > Il 12/09/2012 00:02, Tejun Heo ha scritto: >> SG_IO itself is a bypassing interface. It bypasses most of block >> layer and the kernel doesn't have any idea (apart from the adhoc >> filtering) about what's going on. > > That's very m

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Paolo Bonzini
Il 12/09/2012 00:02, Tejun Heo ha scritto: > SG_IO itself is a bypassing interface. It bypasses most of block > layer and the kernel doesn't have any idea (apart from the adhoc > filtering) about what's going on. That's very much the point. The guest must have free reins. You asked "Could being

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Tejun Heo
Hello, Paolo. On Tue, Sep 11, 2012 at 11:50:38PM +0200, Paolo Bonzini wrote: > > Either way, with or without virtualization, making detailed error > > information to userland is a valid goal. I *think* we're finally > > getting there after years of talking via structured printk. I don't > > know

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Paolo Bonzini
[Al: you can jump down to "One problem:"] Il 11/09/2012 22:01, Tejun Heo ha scritto: > Hello, Paolo. > > On Tue, Sep 11, 2012 at 09:24:32PM +0200, Paolo Bonzini wrote: >>> Couldn't it intercept some of them - e.g. RWs and discards? >>> What's the benifit / use case of doing pure bypass? >> >> Bas

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Tejun Heo
Hello, Paolo. On Tue, Sep 11, 2012 at 09:24:32PM +0200, Paolo Bonzini wrote: > > Couldn't it intercept some of them - e.g. RWs and discards? > > What's the benifit / use case of doing pure bypass? > > Basically, using the same storage technology for bare metal and > virtualized systems. IMHO los

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Paolo Bonzini
Il 11/09/2012 21:13, Tejun Heo ha scritto: > Hello, Paolo. > > On Tue, Sep 11, 2012 at 08:54:03PM +0200, Paolo Bonzini wrote: >>> On Tue, Sep 11, 2012 at 07:56:53PM +0200, Paolo Bonzini wrote: Understood; unfortunately, there is another major user of it (virtualization). If you are pass

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Tejun Heo
Hello, Paolo. On Tue, Sep 11, 2012 at 08:54:03PM +0200, Paolo Bonzini wrote: > > On Tue, Sep 11, 2012 at 07:56:53PM +0200, Paolo Bonzini wrote: > >> Understood; unfortunately, there is another major user of it > >> (virtualization). If you are passing "raw" LUNs down to a virtual > >> machine, th

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Paolo Bonzini
Il 11/09/2012 20:29, Tejun Heo ha scritto:> Hello, Paolo. > > On Tue, Sep 11, 2012 at 07:56:53PM +0200, Paolo Bonzini wrote: >> Understood; unfortunately, there is another major user of it >> (virtualization). If you are passing "raw" LUNs down to a virtual >> machine, there's no possibility at a

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Tejun Heo
Hello, Paolo. On Tue, Sep 11, 2012 at 07:56:53PM +0200, Paolo Bonzini wrote: > Understood; unfortunately, there is another major user of it > (virtualization). If you are passing "raw" LUNs down to a virtual > machine, there's no possibility at all to use a properly encapsulated Is there still c

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Paolo Bonzini
Il 11/09/2012 18:59, Tejun Heo ha scritto: > FWIW, I don't think this is the right way to expose functionality > which needs management in terms of access control, interpretation > (stacking drivers) and serving concurrent users. SG_IO filtering was > mostly for cd/dvd burning and other removeable

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-11 Thread Tejun Heo
Hello, On Fri, Jul 20, 2012 at 06:30:01PM +0200, Paolo Bonzini wrote: > These commands cannot be issued right now without giving CAP_SYS_RAWIO to > the process who wishes to send them. These commands can be useful also to > non-privileged programs who have access to the block devices. For exampl

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-06 Thread Lukáš Czerner
Subject: Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without > CAP_SYS_RAWIO > > Il 06/09/2012 14:08, Ric Wheeler ha scritto: > >> According to the standard, the translation layer can write a > >> user-provided pattern to every sector in the disk. It&#x

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-06 Thread Paolo Bonzini
Il 06/09/2012 14:08, Ric Wheeler ha scritto: >> According to the standard, the translation layer can write a >> user-provided pattern to every sector in the disk. It's an optional >> feature and libata doesn't do that, but it is still possible. > > It is not possible today with our stack though,

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-06 Thread Ric Wheeler
On 09/06/2012 07:49 AM, Paolo Bonzini wrote: Il 06/09/2012 13:31, Ric Wheeler ha scritto: Both of these commands are destructive. WRITE_SAME (if done without the discard bits set) can also take a very long time to be destructive and tie up the storage. FORMAT_UNIT has the same characteristics a

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-06 Thread Paolo Bonzini
Il 06/09/2012 13:31, Ric Wheeler ha scritto: >>> Both of these commands are destructive. WRITE_SAME (if done without the >>> discard bits set) can also take a very long time to be destructive and >>> tie up the storage. >> >> FORMAT_UNIT has the same characteristics and yet it is allowed (btw, I >>

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-06 Thread Ric Wheeler
On 09/06/2012 02:31 AM, Paolo Bonzini wrote: Il 05/09/2012 22:18, Ric Wheeler ha scritto: Hi Paolo, Both of these commands are destructive. WRITE_SAME (if done without the discard bits set) can also take a very long time to be destructive and tie up the storage. FORMAT_UNIT has the same charac

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-05 Thread Paolo Bonzini
Il 05/09/2012 22:18, Ric Wheeler ha scritto: >> > > Hi Paolo, > > Both of these commands are destructive. WRITE_SAME (if done without the > discard bits set) can also take a very long time to be destructive and > tie up the storage. FORMAT_UNIT has the same characteristics and yet it is allowed

Re: [Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-05 Thread Ric Wheeler
On 09/05/2012 10:41 AM, Paolo Bonzini wrote: Il 28/08/2012 13:04, Paolo Bonzini ha scritto: Il 01/08/2012 17:53, Paolo Bonzini ha scritto: Il 20/07/2012 18:30, Paolo Bonzini ha scritto: These commands cannot be issued right now without giving CAP_SYS_RAWIO to the process who wishes to send the

[Ping^3] Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-09-05 Thread Paolo Bonzini
Il 28/08/2012 13:04, Paolo Bonzini ha scritto: > Il 01/08/2012 17:53, Paolo Bonzini ha scritto: >> Il 20/07/2012 18:30, Paolo Bonzini ha scritto: >>> These commands cannot be issued right now without giving CAP_SYS_RAWIO to >>> the process who wishes to send them. These commands can be useful also

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-08-28 Thread Paolo Bonzini
Il 01/08/2012 17:53, Paolo Bonzini ha scritto: > Il 20/07/2012 18:30, Paolo Bonzini ha scritto: >> These commands cannot be issued right now without giving CAP_SYS_RAWIO to >> the process who wishes to send them. These commands can be useful also to >> non-privileged programs who have access to th

Re: [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-08-01 Thread Paolo Bonzini
Il 20/07/2012 18:30, Paolo Bonzini ha scritto: > These commands cannot be issued right now without giving CAP_SYS_RAWIO to > the process who wishes to send them. These commands can be useful also to > non-privileged programs who have access to the block devices. For example > a virtual machine mo

[PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO

2012-07-20 Thread Paolo Bonzini
These commands cannot be issued right now without giving CAP_SYS_RAWIO to the process who wishes to send them. These commands can be useful also to non-privileged programs who have access to the block devices. For example a virtual machine monitor needs them to forward trim/discard to host disks.