Re: [PATCH] rbd: fix integer overflow in rbd_header_from_disk()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux