]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dm-ima: use SHA-256 library
authorEric Biggers <ebiggers@kernel.org>
Thu, 26 Feb 2026 01:39:15 +0000 (17:39 -0800)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 2 Mar 2026 16:02:09 +0000 (17:02 +0100)
commit5282ac80183bd25e44c4f5f52a7f46e9a54289eb
tree85bd6934ed199fd485e0058f21fb48c2a01f306b
parent51d81e14fe6788dc6463064c7517480f2acd2724
dm-ima: use SHA-256 library

Make dm_ima_measure_on_table_load() use the SHA-256 library API instead
of crypto_shash to calculate the SHA-256 hash value that it needs.  This
is simpler and more efficient.  It also ensures that SHA-256 is actually
available and doesn't fail due to the unreliable loading by name.

While doing this, also use kasprintf() to simplify building the string
version of the digest.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/Kconfig
drivers/md/dm-ima.c
drivers/md/dm-ima.h