[patch 1/6][RFC] Keep FIBMAP from looking at negative block nrs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return an error if the user requests a negative logical block in a file.

Signed-off-by: Mike Waychison <mikew@xxxxxxxxxx>
 fs/ioctl.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.23/fs/ioctl.c
===================================================================
--- linux-2.6.23.orig/fs/ioctl.c	2007-10-26 15:25:48.000000000 -0700
+++ linux-2.6.23/fs/ioctl.c	2007-10-26 16:16:29.000000000 -0700
@@ -60,6 +60,8 @@ static int file_ioctl(struct file *filp,
 				return -EPERM;
 			if ((error = get_user(block, p)) != 0)
 				return error;
+			if (block < 0)
+				return -EINVAL;
 
 			lock_kernel();
 			res = mapping->a_ops->bmap(mapping, block);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux