mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] dm-integrity: Remove unreachable code in dm_integrity_ctr()
@ 2025-09-08 12:08 Ivan Abramov
  2025-09-08 13:44 ` Mikulas Patocka
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Abramov @ 2025-09-08 12:08 UTC (permalink / raw)
  To: Alasdair Kergon
  Cc: Ivan Abramov, Mike Snitzer, Mikulas Patocka, dm-devel,
	linux-kernel, lvc-project

Since bi->metadata_size is an unsigned char, it's not practically
possible for it to be > PAGE_SIZE / 2.

Thus, remove the corresponding if statement.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
---
 drivers/md/dm-integrity.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index efeee0a873c0..b7ad7a5adb56 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -4752,11 +4752,6 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
 			ti->error = "The integrity profile is smaller than tag size";
 			goto bad;
 		}
-		if ((unsigned long)bi->metadata_size > PAGE_SIZE / 2) {
-			r = -EINVAL;
-			ti->error = "Too big tuple size";
-			goto bad;
-		}
 		ic->tuple_size = bi->metadata_size;
 		if (1 << bi->interval_exp != ic->sectors_per_block << SECTOR_SHIFT) {
 			r = -EINVAL;
-- 
2.39.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-08 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-08 12:08 [PATCH 1/1] dm-integrity: Remove unreachable code in dm_integrity_ctr() Ivan Abramov
2025-09-08 13:44 ` Mikulas Patocka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®