patch-pre2.0.2 linux/include/linux/blk.h

Next file: linux/scripts/MAKEDEV.ide
Previous file: linux/fs/binfmt_java.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.1/linux/include/linux/blk.h linux/include/linux/blk.h
@@ -107,8 +107,9 @@
 #endif
 
 #define RO_IOCTLS(dev,where) \
-  case BLKROSET: if (!suser()) return -EACCES; \
-		 set_device_ro((dev),get_fs_long((long *) (where))); return 0; \
+  case BLKROSET: { int __err;  if (!suser()) return -EACCES; \
+		   __err = verify_area(VERIFY_READ, (void *) (where), sizeof(long)); \
+		   if (!__err) set_device_ro((dev),get_fs_long((long *) (where))); return __err; } \
   case BLKROGET: { int __err = verify_area(VERIFY_WRITE, (void *) (where), sizeof(long)); \
 		   if (!__err) put_fs_long(0!=is_read_only(dev),(long *) (where)); return __err; }
 		 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this