]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - block/ioctl.c
IB/rxe: Prevent from completer to operate on non valid QP
[karo-tx-linux.git] / block / ioctl.c
index f856963204f4949f5197c1cb0c0a247ca12c95da..be7f4de3eb3cfe7edc7a95644b2d9ee350703b88 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/fs.h>
 #include <linux/blktrace_api.h>
 #include <linux/pr.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg)
 {
@@ -45,6 +45,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                                    || pstart < 0 || plength < 0 || partno > 65535)
                                        return -EINVAL;
                        }
+                       /* check if partition is aligned to blocksize */
+                       if (p.start & (bdev_logical_block_size(bdev) - 1))
+                               return -EINVAL;
 
                        mutex_lock(&bdev->bd_mutex);