]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dm-ima: Fix issues with dm_ima_measure_on_device_rename
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 29 Apr 2026 20:21:05 +0000 (16:21 -0400)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 4 May 2026 12:53:27 +0000 (14:53 +0200)
commit7f3ff42e1858f064b3bd8e3ef32f508185563cf9
tree0e0b90d32aefcd540ee1db19942db14ceee32bd1
parentc90decb190bcae6a20b3aa8575f69eef543930e5
dm-ima: Fix issues with dm_ima_measure_on_device_rename

dm_ima_measure_on_device_rename() can be called on a device before it
ever loads a table, so it needs to handle the case where there is no
table metadata. Also, it was only updating the table_metadata on the
active table. If there was an inactive table when the device was renamed
and that table was later swapped in as the active table, it would
still have the old name. dm_ima_measure_on_device_rename() was also
needlessly allocating new memory for the updated table metadata, instead
of just reusing the existing memory.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-ima.c