summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2025-09-08 15:52:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-12 12:56:21 +0200
commit4b91d0c5781a48639b13071f2d8df8efff320d4d (patch)
tree0aa810e9c82c633cab039ec809badbc87d72dc36
parent7f7187118bb5702f21516b8e8994300b51ecf0fd (diff)
downloadlinux-4b91d0c5781a48639b13071f2d8df8efff320d4d.tar.gz
linux-4b91d0c5781a48639b13071f2d8df8efff320d4d.tar.bz2
linux-4b91d0c5781a48639b13071f2d8df8efff320d4d.zip
dm-integrity: limit MAX_TAG_SIZE to 255
[ Upstream commit 77b8e6fbf9848d651f5cb7508f18ad0971f3ffdb ] MAX_TAG_SIZE was 0x1a8 and it may be truncated in the "bi->metadata_size = ic->tag_size" assignment. We need to limit it to 255. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/md/dm-integrity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 0bd76f8d4dc6..6442d41622ef 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -129,7 +129,7 @@ struct journal_sector {
commit_id_t commit_id;
};
-#define MAX_TAG_SIZE (JOURNAL_SECTOR_DATA - JOURNAL_MAC_PER_SECTOR - offsetof(struct journal_entry, last_bytes[MAX_SECTORS_PER_BLOCK]))
+#define MAX_TAG_SIZE 255
#define METADATA_PADDING_SECTORS 8