]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dm-ima: use active table's size if available
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 29 Apr 2026 20:21:08 +0000 (16:21 -0400)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 4 May 2026 12:53:52 +0000 (14:53 +0200)
commit2ac3de0bbf40ecf32875e0a28b592a5d97d0503e
treee58dc634c8fd81cc96b2358a2b56df80dd60dd62
parent8710ef1fa0715a331f967565a4eb56c6d4b4c15b
dm-ima: use active table's size if available

It is possible that the dm_ima_measure_on_* functions run at the same
time as a table is getting swapped, but before the md->ima.active_table
is updated by dm_ima_measure_on_device_resume(). Instead of using the
current device size, use the size of the active table that is being
measured (assuming there is one), so the information is consistent.
Also, don't allocate a separate string to hold the capactiy. Just
print it directly to the measurement buffer.

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