We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3afcca7 commit fd841eeCopy full SHA for fd841ee
block/ioctl.c
@@ -33,7 +33,7 @@ static int blkpg_do_ioctl(struct block_device *bdev,
33
if (op == BLKPG_DEL_PARTITION)
34
return bdev_del_partition(disk, p.pno);
35
36
- if (p.start < 0 || p.length <= 0 || p.start + p.length < 0)
+ if (p.start < 0 || p.length <= 0 || LLONG_MAX - p.length < p.start)
37
return -EINVAL;
38
/* Check that the partition is aligned to the block size */
39
if (!IS_ALIGNED(p.start | p.length, bdev_logical_block_size(bdev)))
0 commit comments