diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/ioctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index f856963204f4..656c8c6ed206 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -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); |