From: Alex Elder <elder@dreamhost.com>
To: Xi Wang <xi.wang@gmail.com>
Cc: ceph-devel@vger.kernel.org, Yehuda Sadeh <yehuda@hq.newdream.net>,
Sage Weil <sage@newdream.net>
Subject: Re: [PATCH] rbd: fix integer overflow in rbd_header_from_disk()
Date: Wed, 18 Apr 2012 13:47:17 -0500 [thread overview]
Message-ID: <4F8F0C35.8090903@dreamhost.com> (raw)
In-Reply-To: <30227880-FACB-4180-B129-7B5D407094E5@gmail.com>
On 04/18/2012 01:09 PM, Xi Wang wrote:
> On Apr 18, 2012, at 10:21 AM, Alex Elder wrote:
>>
>> This looks good, however I have changed it to use UINT_MAX
>> rather than ULONG_MAX, because on some architectures size_t
>> (__kernel_size_t) is defined as type (unsigned int). It
>> is the more conservative value, and even on architectures
>> where __BITS_PER_LONG is 64, it still offers a sane upper
>> bound on the number of snapshots for a rbd device.
>
> Looks good to me.
>
> BTW, on which arch is size_t 32-bit while long is 64?
> Several commits still use ULONG_MAX, such as
In my tree, these at least *can* be: arm, m68k, mips,
powerpc, sparc, x86, and others (including generic).
It may not matter in practice, but I prefer to be very
careful. As long as you're going out of your way to
avoid overflow might as well make sure it works on all
architectures in the process.
-Alex
> http://git.kernel.org/linus/64486697
>
> - xi
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2012-04-18 18:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 21:52 [PATCH] rbd: fix integer overflow in rbd_header_from_disk() Xi Wang
2012-04-18 14:21 ` Alex Elder
2012-04-18 18:09 ` Xi Wang
2012-04-18 18:47 ` Alex Elder [this message]
2012-04-18 23:59 ` Xi Wang
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=4F8F0C35.8090903@dreamhost.com \
--to=elder@dreamhost.com \
--cc=ceph-devel@vger.kernel.org \
--cc=sage@newdream.net \
--cc=xi.wang@gmail.com \
--cc=yehuda@hq.newdream.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.