Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | Date | Mon, 8 Dec 2003 13:50:12 -0800 | From | William Lee Irwin III <> | Subject | fix 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/
| ![\](/images/icornerr.gif) |