]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm-integrity: fix non-constant-time tag verification
authorJo Van Bulck <jo.vanbulck@kuleuven.be>
Fri, 28 Mar 2025 15:04:47 +0000 (16:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:53 +0000 (10:15 +0200)
commitdd91458a8443d1bbca6ff3ac4eae2af9a88ef12e
tree0edcf0caa1970b4066fde54049833e291379a4f4
parentba42f98f092b0a9d275a3d65635457262d8333d1
dm-integrity: fix non-constant-time tag verification

commit 8bde1033f9cfc1c08628255cc434c6cf39c9d9ba upstream.

When using dm-integrity in standalone mode with a keyed hmac algorithm,
integrity tags are calculated and verified internally.

Using plain memcmp to compare the stored and computed tags may leak the
position of the first byte mismatch through side-channel analysis,
allowing to brute-force expected tags in linear time (e.g., by counting
single-stepping interrupts in confidential virtual machine environments).

Co-developed-by: Luca Wilke <work@luca-wilke.com>
Signed-off-by: Luca Wilke <work@luca-wilke.com>
Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-integrity.c