]> www.infradead.org Git - users/jedix/linux-maple.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)
committerMikulas Patocka <mpatocka@redhat.com>
Fri, 28 Mar 2025 17:25:42 +0000 (18:25 +0100)
commit8bde1033f9cfc1c08628255cc434c6cf39c9d9ba
tree5d7ec614255dec32435b1762f59f4aaa91e014f4
parent5c5d0d7050286e14a6ca18b8d77fc7a34f701206
dm-integrity: fix non-constant-time tag verification

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
drivers/md/dm-integrity.c