]> 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:18:21 +0000 (10:18 +0200)
commite7bcb67cbd8f85147e48b1351c27c5e9b45f430a
tree401519065d82739b762b5ac32f81ccfb489324d7
parent5a5f6f889cee6f925b7b2d04370d7e465e72ccd0
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