Bugzilla – Bug 63491
VUL-0: CVE-2004-0946: nfs-utils overflow on 64bit arch
Last modified: 2021-10-13 11:36:35 UTC
Date: Mon, 22 Nov 2004 11:07:57 -0500 From: Josh Bressers <bressers@redhat.com> To: vendor-sec@lst.de Subject: [vendor-sec] Additional nfs-utils security issue. Parts/Attachments: 1 Shown 46 lines Text 2 OK 29 lines Text ---------------------------------------- This one was found by Arjan van de Ven. struct dqblk { u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */ u_int32_t dqb_curblocks; /* current block count */ u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */ u_int32_t dqb_isoftlimit; /* preferred inode limit */ u_int32_t dqb_curinodes; /* current # allocated inodes */ time_t dqb_btime; /* time limit for excessive disk use */ time_t dqb_itime; /* time limit for excessive files */ }; struct rquota { int rq_bsize; bool_t rq_active; u_int rq_bhardlimit; u_int rq_bsoftlimit; u_int rq_curblocks; u_int rq_fhardlimit; u_int rq_fsoftlimit; u_int rq_curfiles; u_int rq_btimeleft; u_int rq_ftimeleft; }; rquota_server.c line 171 has the following memcpy: memcpy((caddr_t *)&result.getquota_rslt_u.gqr_rquota.rq_bhardlimit, (caddr_t *)&dq_dqb, sizeof(struct dqblk)); the goal of the memcpy is to copy the 8 fields from struct dqblk to the last 8 fields of the struct quota. That is, 6 ints and 2 time_t's get copied to 8 ints. On 32 bit machines, that's ok (but ugly) since a time_t is also a 32 bit value; on 64 bit machines time_t is 64 bit though, thus buffer overflowing the stack. This information should be assumed to be public. This issue has been assigned the CVE id CAN-2004-0946.
<!-- SBZ_reproduce --> Looks to me as he is correct. Our SL 9.2 which I reviewed seems to have this problem.
any patch available already ?
Does this really qualify as a security problem? Yes, it overflows, but the value that gets scribbled past the end of the struct (which should be a static variable BTW if it's standard rpcgen code) is dqb_itime. This is a time limit set by the administrator. I cannot even start to imagine how to exploit this bug in any security relevant way. Fixing this in STABLE should be sufficient, I think.
Would be fine with me. However, you know how people read heise news 'overflow in rpc.quotad'.
now that you mention it: that's perfect ;-) we never used the quotad from nfs-utils (not even sles7), so this is completely unrelated for us. (please close this bug if you agree) PS: But it might be that package quota has a similar problem ...
i have already checked the quota package, it is not affected. good to hear we never used it.
Ok, so fix in STABLE will suffice.
CVE-2004-0946: CVSS v2 Base Score: 10.0 (AV:N/AC:L/Au:N/C:C/I:C/A:C)