summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>2007-02-01 01:01:56 +0000
committermpp <mpp@FreeBSD.org>2007-02-01 01:01:56 +0000
commit3cdb06d461b452f656494c942ddb9cc181e3bcb7 (patch)
tree286b3c12d199d788e9a5cce89bc86a390b208a39 /sys/ufs
parent5f0bd46234ed1427238859d88e9aa03971f8921d (diff)
downloadFreeBSD-src-3cdb06d461b452f656494c942ddb9cc181e3bcb7.zip
FreeBSD-src-3cdb06d461b452f656494c942ddb9cc181e3bcb7.tar.gz
Disallow negative UIDs when processing quotactl options.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_quota.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 5610151..d86e26e 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -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;
OpenPOWER on IntegriCloud