lkml.org 
[lkml]   [2003]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectfix 2.4 BLK_BOUNCE_ANY
The bitshift defining BLK_BOUNCE_ANY can overflow. This patch casts
to u64 before shifting there as well as in BLK_BOUNCE_HIGH to ensure
integer overflow does not occur.

Originally discovered by Zwane Mwaikambo during pgcl development,
submitted by me to mainline to 2.6, and already included in 2.6.


-- wli


===== include/linux/blkdev.h 1.25 vs edited =====
--- 1.25/include/linux/blkdev.h Wed Jul 16 13:20:46 2003
+++ edited/include/linux/blkdev.h Mon Dec 8 13:44:17 2003
@@ -176,8 +176,8 @@

extern unsigned long blk_max_low_pfn, blk_max_pfn;

-#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)

extern void blk_queue_bounce_limit(request_queue_t *, u64);

-
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:59    [W:0.018 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site