dm: limit the number of targets and parameter size area
mainline inclusion from mainline-v6.8-rc3 commit bd504bcfec41a503b32054da5472904b404341a4 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8YCAG CVE: CVE-2024-23851 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bd504bcfec41a503b32054da5472904b404341a4 -------------------------------- 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> Conflicts: drivers/md/dm-core.h drivers/md/dm-ioctl.c drivers/md/dm-table.c commit 91ccbbac ("dm ima: measure data on table load") add "dm ima.h"; commit 8b211aac ("dm: add two stage requeue mechanism") add "struct dm_io;"; commit 249bed82 ("dm ioctl: Avoid double-fetch of version") delete second copy of version; commit dbdcc906 ("dm ioctl: log an error if the ioctl structure is corrupted") add log of error when check data_size fail; commit 05bdb996 ("block: replace fmode_t with a block-specific type for block open flags") change the type of mode and num_targets. Signed-off-by:
Li Lingfeng <lilingfeng3@huawei.com>
Loading
Please sign in to comment