integer overflow at 2^32 in quota calculations
Ondrej Sury
ondrej at sury.org
Wed Jul 13 09:29:57 EDT 2005
> > Actually, it's an unsigned 32-bit value, so the limit is 4GB:
> >
> > https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=2690
> >
> > (Yes, we really do have users who are using more than 4GB of space.)
>
> The limit is still 32-bit signed. It needs to remain unsigned because
> -1 is used to disable the quota. But because the limit is set in KB,
> the limit is actually 2TB. All the patch does is use 64-bit for the
> quota usage so we go beyond 4GB and track up to the limit without
> overflowing.
>
>
> >>this will be different in 2.3
> >
> >
> > Yes, Ken fixed it on 2004-08-09 in the cyrus-imapd-2_3 branch.
> >
> > Ken, off the top of your head, can you think of any gotchas in
> > backporting your quota calculation fixes to 2.2? (I don't want to
> > wait until 2.3 for the fix, as this bug is currently biting us.)
>
> I don't see any problem, as the space for the extra 4-bytes is already
> carved out in cyrus.index. You can probably use 'cvsps' to create a
> patchset. If you don't have it, I can make one for you.
Ken, would you be so kind to generate patchset (and maybe attach it to
mentioned bug report)?
Thanks,
--
Ondrej Sury <ondrej at sury.org>
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list