]> git.baikalelectronics.ru Git - kernel.git/commit
dm table: fail dm_table_create on dm_round_up overflow
authorMikulas Patocka <mpatocka@redhat.com>
Sat, 23 Nov 2013 00:52:06 +0000 (19:52 -0500)
committerMike Snitzer <snitzer@redhat.com>
Tue, 10 Dec 2013 21:34:27 +0000 (16:34 -0500)
commitf329ac920f3473a6fb4be4abcd6ef512c5aca042
tree252b895b66b63a84a166af0142472cdf3a1c3640
parentbfd4302b28f097cf9001e86bb84a556099e90492
dm table: fail dm_table_create on dm_round_up overflow

The dm_round_up function may overflow to zero.  In this case,
dm_table_create() must fail rather than go on to allocate an empty array
with alloc_targets().

This fixes a possible memory corruption that could be caused by passing
too large a number in "param->target_count".

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/dm-table.c