diff options
author | Stephen Tweedie <sct@redhat.com> | 2005-05-18 17:22:31 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-18 18:10:02 +0200 |
commit | e72022e13d659bece2fc9cb2dd97afa67047dbca (patch) | |
tree | c71a8bf39274d7ad105e0618a7f0ff57d1509c17 /drivers/char/raw.c | |
parent | [PATCH] PCI: add MODALIAS to hotplug event for pci devices (diff) | |
download | linux-e72022e13d659bece2fc9cb2dd97afa67047dbca.tar.xz linux-e72022e13d659bece2fc9cb2dd97afa67047dbca.zip |
[PATCH] Fix filp being passed through raw ioctl handler
Don't pass meaningless file handles to block device ioctls.
The recent raw IO ioctl-passthrough fix started passing the raw file
handle into the block device ioctl handler. That's unlikely to be
useful, as the file handle is actually open on a character-mode raw
device, not a block device, so dereferencing it is not going to yield
useful results to a block device ioctl handler.
Previously we just passed NULL; also not a value that can usefully
be dereferenced, but at least if it does happen, we'll oops instead of
silently pretending that the file is a block device, so NULL is the more
defensive option here. This patch reverts to that behaviour.
Noticed by Al Viro.
Signed-off-by: Stephen Tweedie <sct@redhat.com>
Acked-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/char/raw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index 131465e8de5a..ca5f42bcaad9 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -122,7 +122,7 @@ raw_ioctl(struct inode *inode, struct file *filp, { struct block_device *bdev = filp->private_data; - return blkdev_ioctl(bdev->bd_inode, filp, command, arg); + return blkdev_ioctl(bdev->bd_inode, NULL, command, arg); } static void bind_device(struct raw_config_request *rq) |