summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2026-07-09 21:36:01 +0200
committerMikulas Patocka <mpatocka@redhat.com>2026-07-10 14:42:05 +0200
commit88dd117c92a142253fb7a17e791773902b3babc6 (patch)
tree205cd7768ea1730196af4682f4d5afa9ab86e7d5
parente72b793ae440f6900fb17a4b8518c707b5cd3e17 (diff)
downloadlinux-next-88dd117c92a142253fb7a17e791773902b3babc6.tar.gz
linux-next-88dd117c92a142253fb7a17e791773902b3babc6.zip
dm-verity: increase sprintf buffer size
The prefix "DM_VERITY_ERR_BLOCK_NR" is 22 chars. Add '=', one digit for type, ',', up to 20 digits for a u64 block number, and a NUL terminator: that's 46 bytes. The buffer is 42 bytes. For block numbers >= 16 decimal digits (devices larger than ~16 EB with 4K blocks), snprintf silently truncates the uevent environment variable. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Assisted-by: Claude:claude-opus-4.6 Fixes: 65ff5b7ddf05 ("dm verity: add error handling modes for corrupted blocks") Cc: stable@vger.kernel.org
-rw-r--r--drivers/md/dm-verity-target.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
index adfda1fdab6a..e63a8290bd3a 100644
--- a/drivers/md/dm-verity-target.c
+++ b/drivers/md/dm-verity-target.c
@@ -26,7 +26,7 @@
#define DM_MSG_PREFIX "verity"
-#define DM_VERITY_ENV_LENGTH 42
+#define DM_VERITY_ENV_LENGTH 46
#define DM_VERITY_ENV_VAR_NAME "DM_VERITY_ERR_BLOCK_NR"
#define DM_VERITY_DEFAULT_PREFETCH_SIZE 262144