]> git.baikalelectronics.ru Git - kernel.git/commit
dm table: avoid crash if integrity profile changes
authorMike Snitzer <snitzer@redhat.com>
Sun, 25 Sep 2011 22:26:17 +0000 (23:26 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Sun, 25 Sep 2011 22:26:17 +0000 (23:26 +0100)
commit5f5a3efc9daa250737c0b524baa3259adba31459
treedf134b1c01cd6385afe7ff7171eb722063de6b4b
parent87ef4f7454a0e818e505bb4928588260deb675d9
dm table: avoid crash if integrity profile changes

Commit fc683dd (dm: improve block integrity support) introduced a
two-phase initialization of a DM device's integrity profile.  This
patch avoids dereferencing a NULL 'template_disk' pointer in
blk_integrity_register() if there is an integrity profile mismatch in
dm_table_set_integrity().

This can occur if the integrity profiles for stacked devices in a DM
table are changed between the call to dm_table_prealloc_integrity() and
dm_table_set_integrity().

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org # 2.6.39
drivers/md/dm-table.c