Skip to contentSkip to conversation

FAILED: patch "[PATCH] dm-integrity: fix leaking uninitialized kernel memory" failed to apply to 6.12-stable tree

PATCH New [email protected] 2 participants 2 messages Jul 20 – Jul 27

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 7bb03b2b01b814a9fc14afbfc2cbb2cca5b34750
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072033-produce-defense-a018@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 7bb03b2b01b814a9fc14afbfc2cbb2cca5b34750 Mon Sep 17 00:00:00 2001
From: Mikulas Patocka <[email protected]>
Date: Thu, 9 Jul 2026 21:22:47 +0200
Subject: [PATCH] dm-integrity: fix leaking uninitialized kernel memory

If hash size is less than device's tuple size, dm-integrity is supposed to zero the remaining space. There was a bug in the code that zeroing didn't work. This commit fixes it.

Assisted-by Claude:claude-opus-4.6
Fixes fb0987682c62 ("dm-integrity: introduce the Inline mode")
drivers/md/dm-integrity.c +1 -1
index dbabb8e46fb7..02b2805ed33a 100644
@@ -2606,7 +2606,7 @@ static int dm_integrity_map_inline(struct dm_integrity_io *dio, bool from_map)
 			struct bio_vec bv = bio_iter_iovec(bio, dio->bio_details.bi_iter);
 			const char *mem = integrity_kmap(ic, bv.bv_page);
 			if (ic->tag_size < ic->tuple_size)
-				memset(dio->integrity_payload + pos + ic->tag_size, 0, ic->tuple_size - ic->tuple_size);
+				memset(dio->integrity_payload + pos + ic->tag_size, 0, ic->tuple_size - ic->tag_size);
 			integrity_sector_checksum(ic, &dio->ahash_req, dio->bio_details.bi_iter.bi_sector, mem, bv.bv_offset, dio->integrity_payload + pos);
 			integrity_kunmap(ic, mem);
 			pos += ic->tuple_size;
maintainer
#1 lore raw

PATCH 1/1 dm-integrity: fix leaking uninitialized kernel memory

From: Mikulas Patocka <[email protected]>

[ Upstream commit 7bb03b2b01b814a9fc14afbfc2cbb2cca5b34750 ]

If hash size is less than device's tuple size, dm-integrity is supposed to zero the remaining space. There was a bug in the code that zeroing didn't work. This commit fixes it.

Assisted-by Claude:claude-opus-4.6
Fixes fb0987682c62 ("dm-integrity: introduce the Inline mode")
---
 drivers/md/dm-integrity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-integrity.c +1 -1
index b661be629da260..0a7be46701a9c2 100644
@@ -2502,7 +2502,7 @@ static int dm_integrity_map_inline(struct dm_integrity_io *dio, bool from_map)
 			struct bio_vec bv = bio_iter_iovec(bio, dio->bio_details.bi_iter);
 			const char *mem = bvec_kmap_local(&bv);
 			if (ic->tag_size < ic->tuple_size)
-				memset(dio->integrity_payload + pos + ic->tag_size, 0, ic->tuple_size - ic->tuple_size);
+				memset(dio->integrity_payload + pos + ic->tag_size, 0, ic->tuple_size - ic->tag_size);
 			integrity_sector_checksum(ic, dio->bio_details.bi_iter.bi_sector, mem, dio->integrity_payload + pos);
 			kunmap_local(mem);
 			pos += ic->tuple_size;
Signature · 1 line
2.53.0