Skip to content

Commit 77b8e6f

Browse files
author
Mikulas Patocka
committed
dm-integrity: limit MAX_TAG_SIZE to 255
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 <[email protected]>
1 parent 1071d56 commit 77b8e6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-integrity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ struct journal_sector {
133133
commit_id_t commit_id;
134134
};
135135

136-
#define MAX_TAG_SIZE (JOURNAL_SECTOR_DATA - JOURNAL_MAC_PER_SECTOR - offsetof(struct journal_entry, last_bytes[MAX_SECTORS_PER_BLOCK]))
136+
#define MAX_TAG_SIZE 255
137137

138138
#define METADATA_PADDING_SECTORS 8
139139

0 commit comments

Comments
 (0)