[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4EF391A6.2040504@redhat.com>
Date: Thu, 22 Dec 2011 21:23:02 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: linux-kernel@...r.kernel.org, security@...nel.org,
pmatouse@...hat.com, agk@...hat.com, jbottomley@...allels.com,
mchristi@...hat.com, msnitzer@...hat.com
Subject: Re: [PATCH 2/3] block: fail SCSI passthrough ioctls on partition
devices
On 12/22/2011 08:44 PM, Linus Torvalds wrote:
>>> >> This kind of crazy needs to go away.
>> >
>> > What crazy? It's not a permission problem. Sending a SCSI command to a
>> > partition makes no sense. A permission problem implies that somehow you
>> > should be able to fix it by granting additional permissions, which is not
>> > the case here.
> Ahh, I misread the intention here, and didn't notice that it was doing
> it on the stupid SCSI ioctl commands, not the lowlevel SCSI "cmd". The
> fact that the changelog talked about sending read/write commands down
> to the disk confused me.
>
> But please do use ENOIOCTLCMD directly then, instead of using ENOTTY
> and turning it into ENOIOCTLCMD.
I disagree. ENOTTY is perfect in all cases except the compat_ioctl
(which I'm not denying is ugly, but beautifying it would make everything
else ugly).
In fact ENOTTY means "fail", ENOIOCTLCMD means "handle this elsewhere".
Only with compat_ioctl it makes sense to "handle this elsewhere" (we
know that we will get it again in the non-compat fallback path, and
return -ENOTTY).
Secondarily, ENOIOCTLCMD is ultimately turned into EINVAL when the
system call returns (not ENOTTY).
Paolo
--
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