lkml.org 
[lkml]   [2013]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 part1 1/4] sg_io: pass request_queue to blk_verify_command
Il 24/05/2013 10:03, James Bottomley ha scritto:
>>>>> > >>> Does anyone in the real world actually care about this bug?
>>>> > >>
>>>> > >> Yes, or I would move on and not waste so much time on this.
>>> > >
>>> > > Fine, so produce a simple fix for this bug which we can discuss that's
>>> > > not tied to this feature.
>> >
>> > Honestly, I have no idea how this is even possible.
> Really? It looks to me like a simple block on the commands for disk
> devices in the opcode switch would do it (with a corresponding change to
> sg.c:sg_allow_access).

Which switch? What I can do is something like this in blk_verify_command:

if (q->sgio_type == TYPE_ROM)
return 0;
if (rq->cmd[0] == 0xA4)
return -EPERM;
if (!is_write &&
(req->cmd[0] == ... || rq->cmd[0] == ...))
return -EPERM;

But then the particular patch you're replying to is still necessary,
and you're slowing down blk_verify_command. It may be fine for stable
and -rc, but IMHO it calls for a better implementation in 3.11.

(Besides, I did it like this because it is what Tejun suggested).

Paolo


\
 
 \ /
  Last update: 2013-05-24 11:01    [W:0.431 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site