]> git.itanic.dy.fi Git - linux-stable/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 08:12:52 +0000 (09:12 +0100)
commitc5d83ac2bf6ca668a39ffb1a576899a66153ba19
tree06700dee5f6bd66276db2d4771931f757a541bea
parent13f79a002602e562ce425b403fa9797dcf1cfeab
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-core.h
drivers/md/dm-ioctl.c
drivers/md/dm-table.c