]> www.infradead.org Git - users/jedix/linux-maple.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)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 8 Dec 2011 19:16:12 +0000 (11:16 -0800)
commitfbf954b501b6a28e726ec62edc42f44e16c0f887
treea996d8438f47df776a19dbba7141e8c01cd51c19
parent3ddda313ebbff07cce1c862dc22c97f96367e452
dm table: avoid crash if integrity profile changes

commit 876fbba1db4a377f050a2bb49b474c7527b2995d upstream.

Commit a63a5cf (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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-table.c