[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzmCoX17j9h5-RLrPctpf5GAh5i7bG3vDUBKsZoXNFugg@mail.gmail.com>
Date: Thu, 22 Dec 2011 12:52:55 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Paolo Bonzini <pbonzini@...hat.com>
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 Thu, Dec 22, 2011 at 12:23 PM, Paolo Bonzini <pbonzini@...hat.com> wrote:
>
> 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).
No it's not.
ENOTTTY isn't ever perfect. We should never have used it to begin with
inside the kernel.
Why would it make *anything* else uglier? Just return it, don't try to
change it anywhere. Does it break anything?
> Secondarily, ENOIOCTLCMD is ultimately turned into EINVAL when the system
> call returns (not ENOTTY).
That's a completely independent bug that has been discussed several
times. We probably should just bite the bullet and fix it. EINVAL is
never the right return value (unless the per-ioctl arguments
themselves are invalid, not for bad ioctls).
The EINVAL return comes from some people who didn't understand that
ENOTTY means "no such ioctl" despite the name.
But regardless, for your patch, it shouldn't matter.
Linus
--
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