]> git.hungrycats.org Git - linux/commit
dm: limit the number of targets and parameter size area
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 9 Jan 2024 14:57:56 +0000 (15:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:55:14 +0000 (08:55 +0100)
commit888a0a46b80fa37eacfe81faf47ba0b83876251d
treeb6dc58cc301b47e1391e4aebc342b4e919494e2b
parentcf4da91e99f1fd1e77f7cea2cf085710ffe71b72
dm: limit the number of targets and parameter size area

commit bd504bcfec41a503b32054da5472904b404341a4 upstream.

The kvmalloc function fails with a warning if the size is larger than
INT_MAX. The warning was triggered by a syscall testing robot.

In order to avoid the warning, this commit limits the number of targets to
1048576 and the size of the parameter area to 1073741824.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: He Gao <hegao@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-core.h
drivers/md/dm-ioctl.c
drivers/md/dm-table.c