Whamcloud - gitweb
LU-14740 quota: reject invalid project id on server side
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_handler.c
index 3b46322..f2fedaa 100644 (file)
@@ -3088,6 +3088,8 @@ static int osd_quota_transfer(struct inode *inode, const struct lu_attr *attr,
        /* Handle project id transfer here properly */
        if (attr->la_valid & LA_PROJID &&
            attr->la_projid != i_projid_read(inode)) {
+               if (!projid_valid(make_kprojid(&init_user_ns, attr->la_projid)))
+                       return -EINVAL;
 #ifdef HAVE_PROJECT_QUOTA
                rc = osd_transfer_project(inode, attr->la_projid, handle);
 #else