mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Cc: axboe@suse.de
Subject: blkdev.h integer overflows
Date: Mon, 23 Dec 2002 08:17:36 -0800	[thread overview]
Message-ID: <20021223161736.GY25000@holomorphy.com> (raw)

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

                 reply	other threads:[~2002-12-23 16:10 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=20021223161736.GY25000@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome