diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2025-09-08 15:52:02 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-12 13:01:01 +0200 |
| commit | 93936f2de5524cd8fcf1b0eefb42668bfacfcc66 (patch) | |
| tree | 240dc8ac4aff366d01e9630d960c37af28e627fc | |
| parent | 08fcde8b5645a17364774ae9d4e1365cd298c46a (diff) | |
| download | linux-stable-93936f2de5524cd8fcf1b0eefb42668bfacfcc66.tar.gz linux-stable-93936f2de5524cd8fcf1b0eefb42668bfacfcc66.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 4395657fa583..7b1d8f0c62fd 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -133,7 +133,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 |
