* fix 2.4 BLK_BOUNCE_ANY
@ 2003-12-08 21:50 William Lee Irwin III
0 siblings, 0 replies; only message in thread
From: William Lee Irwin III @ 2003-12-08 21:50 UTC (permalink / raw)
To: marcelo.tosatti; +Cc: linux-kernel
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-12-08 21:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-08 21:50 fix 2.4 BLK_BOUNCE_ANY William Lee Irwin III
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).