lkml.org 
[lkml]   [2002]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectblkdev.h integer overflows
blk_max_pfn is an unsigned long; left shifting by PAGE_SHIFT means
it may overflow.


Bill


diff -urpN mm2-2.5.52-1/include/linux/blkdev.h blk-2.5.52-1/include/linux/blkdev.h
--- mm2-2.5.52-1/include/linux/blkdev.h 2002-12-18 22:01:01.000000000 -0800
+++ blk-2.5.52-1/include/linux/blkdev.h 2002-12-23 08:06:25.000000000 -0800
@@ -297,8 +297,8 @@ extern unsigned long blk_max_low_pfn, bl
* BLK_BOUNCE_ANY : don't bounce anything
* BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary
*/
-#define BLK_BOUNCE_HIGH (blk_max_low_pfn << PAGE_SHIFT)
-#define BLK_BOUNCE_ANY (blk_max_pfn << PAGE_SHIFT)
+#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT)
+#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT)
#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)

extern int init_emergency_isa_pool(void);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:31    [W:0.309 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site