From: William Lee Irwin III <wli@holomorphy.com>
To: marcelo.tosatti@cyclades.com
Cc: linux-kernel@vger.kernel.org
Subject: fix 2.4 BLK_BOUNCE_ANY
Date: Mon, 8 Dec 2003 13:50:12 -0800 [thread overview]
Message-ID: <20031208215012.GC19856@holomorphy.com> (raw)
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);
reply other threads:[~2003-12-08 21:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031208215012.GC19856@holomorphy.com \
--to=wli@holomorphy.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).