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 4d12489 commit a6bb2ffCopy full SHA for a6bb2ff
block/ioctl.c
@@ -32,7 +32,7 @@ static int blkpg_do_ioctl(struct block_device *bdev,
32
if (op == BLKPG_DEL_PARTITION)
33
return bdev_del_partition(bdev, p.pno);
34
35
- 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)
36
return -EINVAL;
37
/* Check that the partition is aligned to the block size */
38
if (!IS_ALIGNED(p.start | p.length, bdev_logical_block_size(bdev)))
0 commit comments