summaryrefslogtreecommitdiff
path: root/drivers/md/dm-delay.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2013-11-23 04:51:39 +0400
committerMike Snitzer <snitzer@redhat.com>2014-01-07 19:11:44 +0400
commit57a2f238564e0700c8648238d31f366246a5b963 (patch)
treeec5ec772a766a1cb56b83dc98280424ec20791ef /drivers/md/dm-delay.c
parent19fa1a6756ed9e92daa9537c03b47d6b55cc2316 (diff)
downloadlinux-57a2f238564e0700c8648238d31f366246a5b963.tar.xz
dm table: remove unused buggy code that extends the targets array
A device mapper table is allocated in the following way: * The function dm_table_create is called, it gets the number of targets as an argument -- it allocates a targets array accordingly. * For each target, we call dm_table_add_target. If we add more targets than were specified in dm_table_create, the function dm_table_add_target reallocates the targets array. However, this reallocation code is wrong - it moves the targets array to a new location, while some target constructors hold pointers to the array in the old location. The following DM target drivers save the pointer to the target structure, so they corrupt memory if the target array is moved: multipath, raid, mirror, snapshot, stripe, switch, thin, verity. Under normal circumstances, the reallocation function is not called (because dm_table_create is called with the correct number of targets), so the buggy reallocation code is not used. Prior to the fix "dm table: fail dm_table_create on dm_round_up overflow", the reallocation code could only be used in case the user specifies too large a value in param->target_count, such as 0xffffffff. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-delay.c')
0 files changed, 0 insertions, 0 deletions