Disallow negative UIDs when processing quotactl options.

This commit is contained in:
Mike Pritchard 2007-02-01 01:01:56 +00:00
parent 4e99994cc9
commit 3c0508582d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166380

View File

@ -891,6 +891,11 @@ dqget(vp, id, ump, type, dqp)
struct uio auio;
int error;
/* XXX: Disallow negative id values to prevent the
* creation of 100GB+ quota data files.
*/
if ((int)id < 0)
return (EINVAL);
dqvp = ump->um_quotas[type];
if (dqvp == NULLVP || (ump->um_qflags[type] & QTF_CLOSING)) {
*dqp = NODQUOT;