[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120912134124.55d968ef@pyramind.ukuu.org.uk>
Date: Wed, 12 Sep 2012 13:41:24 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
James Bottomley <James.Bottomley@...senPartnership.com>,
Jens Axboe <axboe@...nel.dk>,
Ric Wheeler <rwheeler@...hat.com>, linux-scsi@...r.kernel.org
Subject: Re: [PATCH 3/3] block: add back command filter modification via
sysfs
> +ssize_t blk_filter_store(struct request_queue *q,
> + const char *page, size_t count, int rw)
> +{
> + unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
> + bool set;
> + const char *p = page;
> + char *endp;
> + int start = -1, cmd;
> +
> + if (!q->cmd_filter) {
> + q->cmd_filter = kmalloc(sizeof(struct blk_cmd_filter),
> + GFP_KERNEL);
> + blk_set_cmd_filter_defaults(q->cmd_filter);
> + }
> +
This also needs CAP_SYS_RAWIO otherwise you have a capability escalation
path.
I'm not really in favour of this patch as is. It's not as flexible as
doing it with a BPF filter which if we are going to have a new API is
going to be cleaner, faster and has a clear understood API plus tools.
With BPF you can do things like enabling command A with option B on a
specific device for a certain block range.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists