linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Tejun Heo <tj@kernel.org>, Ric Wheeler <rwheeler@redhat.com>,
	Petr Matousek <pmatouse@redhat.com>, Kay Sievers <kay@redhat.com>,
	Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: Re: setting up CDB filters in udev (was Re: [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs)
Date: Wed, 31 Oct 2012 13:52:29 +0100	[thread overview]
Message-ID: <50911F0D.4030901@redhat.com> (raw)
In-Reply-To: <1657557410.1945557.1351190120407.JavaMail.root@redhat.com>

Ping?

Paolo

Il 25/10/2012 20:35, Paolo Bonzini ha scritto:
>> On Thu, Oct 25, 2012 at 09:37:39AM +0200, Paolo Bonzini wrote:
>>> Il 24/10/2012 18:47, Tejun Heo ha scritto:
>>>> So, I'm still not convinced we need to go forward with full
>>>> configurability. All use cases you described can be covered with
>>>> per-class static filters + simple override switch to disable all,
>>>> which would result in a lot simpler implementation w/ much
>>>> smaller userland interface.
>>>
>>> I'm not sure the userland interface would be smaller, and it would
>>> be more complex to get right:
>>>
>>> 1) how do you override the default?  ioctl+SCM_RIGHTS or sysfs?
>>
>> Disabling filters if opened by root and tranfering via SCM_RIGHTS
>> would be the simplest interface-wise (there's no new interface at
>> all).  Would that be too dangerous security-wise?
> 
> That would be a change with respect to what we have now.  After
> transferring a root-opened (better: CAP_SYS_RAWIO-opened) file
> descriptor to an unprivileged process your SG_IO commands get
> filtered.  So a ioctl is needed if you want to rely on SCM_RIGHTS.
> 
>>> 2) do you need to override the default to "no access", "full
>>> access" and "default access", or is a binary knob (default
>>> access/full access) sufficient?
>>
>> Default / full should be enough, no?
> 
> If a ioctl has to be added, I'd rather have at least none/full/default.
> 
>>> 3) what capabilities control the setting?
>>
>> CAP_SYS_RAWIO seems to be a pretty good fit.
> 
> Yes, for a ioctl it is (for sysfs CAP_SYS_ADMIN is better IMHO).
> 
>> I guess I just feel quite reluctant to expose another rather obscure
>> userland configurable in-kernel filter and at the same time I'm not
>> sure whether this is flexible enough.  What if a device is shared by
>> multiple virtual machines which are trusted at different levels?
> 
> No, you just don't do that.  If a device is passed through to virtual
> machines, it is between similar virtual machines (for some definition
> of similar).  The only case where you have this sharing is in practice
> if either the device is read-only (my patch does give you a basic
> two-level filtering, with two separate bitmaps for RO and RW) or if you
> allow persistent reservations (which is as close to full trust as you
> can get).
> 
>> I'm not trying to block it at all cost but let's make sure we looked
>> into most possibilities before (re)adding this userland visible
>> interface.
> 
> Sure, understood. :)
> 
>> Jens, James, what do you guys think?
> 
> Paolo
> 


  reply	other threads:[~2012-10-31 12:52 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25 15:30 [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs Paolo Bonzini
2012-09-25 15:30 ` [PATCH v2 1/3] block: add back queue-private command filter Paolo Bonzini
2012-09-25 15:30 ` [PATCH v2 2/3] scsi: create an all-zero filter for scanners Paolo Bonzini
2012-09-25 15:30 ` [PATCH v2 3/3] block: add back command filter modification via sysfs Paolo Bonzini
2012-10-04 10:12 ` [PATCH v2 0/3] block: add queue-private command filter, editable " Paolo Bonzini
2012-10-19  0:22   ` Tejun Heo
2012-10-19  9:07     ` Paolo Bonzini
     [not found]       ` <2007908429.13363375.1350637872646.JavaMail.root@redhat.com>
     [not found]         ` <20121019201058.GP13370@google.com>
     [not found]           ` <5087E093.50700@redhat.com>
     [not found]             ` <CAOS58YM5ZO9h0XUCNxV+6U3UzpeUen5ZuyqsNEUaJ81ux=QKvw@mail.gmail.com>
     [not found]               ` <5088EC43.2010600@redhat.com>
2012-10-25 18:00                 ` setting up CDB filters in udev (was Re: [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs) Tejun Heo
2012-10-25 18:35                   ` Paolo Bonzini
2012-10-31 12:52                     ` Paolo Bonzini [this message]
2012-10-31 21:22                     ` Tejun Heo
2012-11-02 14:49                       ` Paolo Bonzini
2012-11-02 15:35                         ` Alan Cox
2012-11-02 16:48                           ` Tejun Heo
2012-11-02 17:21                             ` Alan Cox
2012-11-02 17:30                               ` Tejun Heo
2012-11-02 20:18                                 ` Alan Cox
2012-11-02 20:21                                   ` Tejun Heo
2012-11-02 20:48                                     ` Alan Cox
2012-11-02 22:59                                       ` Tejun Heo
2012-11-02 23:52                                         ` Alan Cox
2012-11-02 23:58                                           ` Tejun Heo
2012-11-03  0:19                                             ` Alan Cox
2012-11-03  0:23                                               ` Tejun Heo
2012-11-03  0:52                                                 ` Alan Cox
2012-11-02 16:51                         ` Tejun Heo
2012-11-02 17:49                           ` Paolo Bonzini
2012-11-02 17:53                             ` Tejun Heo
2012-11-03 13:20                               ` Paolo Bonzini
2012-11-03 14:50                                 ` Alan Cox
2012-11-05 11:08                                   ` Paolo Bonzini
2012-11-05 18:18                                   ` Tejun Heo
2012-11-05 20:12                                     ` Alan Cox
2012-11-05 20:09                                       ` Tejun Heo
2012-11-05 20:17                                         ` Alan Cox
2012-11-05 20:15                                           ` Tejun Heo
2012-11-05 18:26                                 ` Tejun Heo

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=50911F0D.4030901@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=axboe@kernel.dk \
    --cc=kay@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmatouse@redhat.com \
    --cc=rwheeler@redhat.com \
    --cc=tj@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).