[dm-devel] Missing chunk size constraint in dm-stripe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ensure number of stripe chunks fits into 32 bits.
--- diff/drivers/md/dm-stripe.c	2005-01-21 15:10:13.000000000 +0000
+++ source/drivers/md/dm-stripe.c	2005-01-21 15:09:47.000000000 +0000
@@ -135,6 +135,11 @@
 		chunk_size >>= 1;
 	sc->chunk_shift--;
 
+	if ((sizeof(ti->len) > 4) && (ti->len >> 32 >> sc->chunk_shift)) {
+		ti->error = "dm-stripe: Chunk size too small for stripe";
+		return -EINVAL;
+	}
+
 	/*
 	 * Get the stripe destinations.
 	 */


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux