2005-08-30 05:08:54

by Mike Frysinger

[permalink] [raw]
Subject: rquota overflow fix never applied ?

Gentoo and Fedora both apply an old patch to resolve an overflow issue ... is
this just a case of fixes never going upstream or is there a reason this
hasnt been applied ... if so, can someone please clue me in ;)
-mike


Attachments:
(No filename) (222.00 B)
nfs-utils-0.3.3-rquotad-overflow.patch (1.21 kB)
Download all attachments

2005-08-30 06:09:40

by NeilBrown

[permalink] [raw]
Subject: Re: rquota overflow fix never applied ?

On Tuesday August 30, [email protected] wrote:
> Gentoo and Fedora both apply an old patch to resolve an overflow issue ... is
> this just a case of fixes never going upstream or is there a reason this
> hasnt been applied ... if so, can someone please clue me in ;)
> -mike

Well..... the patch does seem to be somewhat flawed .....
There is a comment, and matching code, and the code is changed, but
not the comment !!! :-)

However I don't think that would be the reason. I think it either has
not been sent upstream, it when it was it was missed and not resent.

I have added it to my tree, with appropriate changes to the comment.

However I seem to be a bit thick today and cannot see where the
overflow is happening.
dqblk is 6 u_int32_t's and 2 time_t's
struct rquota (after rq_bhardlimit) is 8 u_int's

On what arch are there different?
(maybe time_t isn't 32bits everwhere, is that it?)

NeilBrown

> @@ -168,8 +169,16 @@ getquota_rslt *getquotainfo(int flags, c
> * Make a copy of the info into the last part of the remote quota
> * struct which is exactly the same.
> */


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-08-30 13:20:45

by Mike Frysinger

[permalink] [raw]
Subject: Re: rquota overflow fix never applied ?

On Tuesday 30 August 2005 02:09 am, Neil Brown wrote:
> On Tuesday August 30, [email protected] wrote:
> > Gentoo and Fedora both apply an old patch to resolve an overflow issue
> > ... is this just a case of fixes never going upstream or is there a
> > reason this hasnt been applied ... if so, can someone please clue me in
> > ;)
>
> Well..... the patch does seem to be somewhat flawed .....
> There is a comment, and matching code, and the code is changed, but
> not the comment !!! :-)

i'm just the messenger, i didnt write it ;)

> However I don't think that would be the reason. I think it either has
> not been sent upstream, it when it was it was missed and not resent.
>
> I have added it to my tree, with appropriate changes to the comment.
>
> However I seem to be a bit thick today and cannot see where the
> overflow is happening.
> dqblk is 6 u_int32_t's and 2 time_t's
> struct rquota (after rq_bhardlimit) is 8 u_int's
>
> On what arch are there different?
> (maybe time_t isn't 32bits everwhere, is that it?)

the overflow occurs on 64bit arches due to the size differences in time_t ...
for original description of the issue and author of the patch, please see
(sorry, should have included this in the first e-mail):
http://bugs.gentoo.org/72113
-mike


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-08-30 16:05:48

by Trond Myklebust

[permalink] [raw]
Subject: Re: rquota overflow fix never applied ?

ty den 30.08.2005 Klokka 16:09 (+1000) skreiv Neil Brown:

> However I seem to be a bit thick today and cannot see where the
> overflow is happening.
> dqblk is 6 u_int32_t's and 2 time_t's

Isn't time_t defined to be unsigned long?

> struct rquota (after rq_bhardlimit) is 8 u_int's

Whether or not it fixes the particular problem it claims to, this is a
patch we should apply (or we should write something similar).

It is just evil to do direct memcpy between different structures. As
soon as someone does something that changes field alignments, starts
appending new fields,... on one structure but not the other, you
immediately get into trouble.

Cheers,
Trond



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-09-02 06:43:00

by NeilBrown

[permalink] [raw]
Subject: Re: rquota overflow fix never applied ?


(drat ... sent this with the wrong 'from' address first time and
as nfs-utils is a closed list (grumble grumble) it bounced...
)

On Tuesday August 30, [email protected] wrote:
> ty den 30.08.2005 Klokka 16:09 (+1000) skreiv Neil Brown:
>
> > However I seem to be a bit thick today and cannot see where the
> > overflow is happening.
> > dqblk is 6 u_int32_t's and 2 time_t's
>
> Isn't time_t defined to be unsigned long?
>
> > struct rquota (after rq_bhardlimit) is 8 u_int's
>
> Whether or not it fixes the particular problem it claims to, this is a
> patch we should apply (or we should write something similar).

True, and I have now committed it to CVS.
It's just that I like to make sure that I understand a problem
completely before 'fixing' it - it is very easy to miss little details
(though I cannot see any room for hidden details here).

NeilBrown


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs