From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Tejun Heo <tj@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
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: Sat, 3 Nov 2012 00:52:10 +0000 [thread overview]
Message-ID: <20121103005210.1f66b568@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <20121103002328.GI27843@mtj.dyndns.org>
> So, my first response was whether you mean to add arbitrary range
> filtering for standard read/writes too. If you're not gonna do that
Thats relevant for /dev/sd but not /dev/sg. Now it might be the sane
thing to do is to support BPF filters on /dev/sg only ?
> But we should't add features for the ones which haven't been
> considered. Unless you can actually justify with actual use cases,
> it's just hand waving.
The CD writer one isn't but you tried to dismiss that too.
> The suggested mechanism is just having a switch to allow all SG_IO
> commands and pass it to the hypervisor. There's no filtering in
> kernel at all.
That requires you have a very trusted hypervisor, that to me is a
weaker model because it increases the probability that a hack on a
guest of a cloud becomes a hack of the cloud itself at least in terms of
quiet data theft from other guests. It's still a minor risk because
you've got to break the guest then break the hypervisor from guest
virtual ring 0, but the hypervisor is a large target,
For a lot of cases being able to do the filtering in the hypervisor makes
sense and I don't have a problem with that except that you do need to
enforce CAP_SYS_RAWIO on the process setting the flags or you break the
kernel capability model. For a hypervisor guest flipping flags at boot
thats not a big deal.
> > We have filtering because it is necessary. All you are doing is putting
> > off the inevitable by adding more kernel hack "one true kernel enforced
> > religion" policy and putting off the inevitable while adding APIs you'll
> > then have to maintain until the job is done right.
> >
> > Ultimately policy has to be user space driven, adding more temporary
> > hacks is just a waste.
>
> Exactly, let's provide a turn-off switch for in-kernel filtering and
> let userland drive any appropriate access policy on it. Let's please
> stay away from doing deep packet inspecting on SG_IO commands.
And you've left stuff like CD burning broken still despite people pointing
out for years that sorting out the filtering would fix it.
> I don't think we're disagreeing on the principle. It's just that
> we're drawing different where the line lies between mechanisms and
> policies.
On the CD burning case and on generality I think we are disagreeing in
principle. Which isn't to say there is a right answer and one of us is an
idiot, just that there are things to consider carefully here.
IMHO you are hacking kernel policy by a magic flag to support a specific
problem case, not fixing the problem. The question is whether the problem
needs fixing 8)
Alan
next prev parent reply other threads:[~2012-11-03 0:47 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
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 [this message]
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=20121103005210.1f66b568@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=kay@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--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
all inboxes | Powered by JetHome®