Re: [PATCH 2/3] block: fail SCSI passthrough ioctls on partitiondevices

From: Paolo Bonzini
Date: Thu Jan 05 2012 - 12:26:54 EST


On 01/05/2012 06:04 PM, Linus Torvalds wrote:

> Foolish me who found a bug, and an exploitable one for that matter, and even
> tried to fix it. Looks like security by obscurity would have served users better.
Umm. I just sent out what I think is what we*should* be doing.

You are the one who seems to just want to add hack upon hack to
things. THAT is what I really hate. It's not only in bad taste, it
*will* come back and bite us some day.

I could have just written

+ ret = scsi_verify_blk_ioctl(bdev, cmd);
+ if (ret < 0)
+ return -ENOIOCTLCMD;

It wouldn't have been any less hacky, but it would have looked quite normal and perhaps it would have escaped review. I knew I was working around messy code, and I made that clear. In that, I succeeded. :)

If you think that "security" is about adding new special cases and
hacks, you're so out to lunch that it isn't even funny. It is
absolutely the*last* thing you want.

Thanks for the tip, :) and thanks for picking up the cleanup. I'll keep an eye and resubmit when the dust settles.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/