Commit 2c79b9bf authored by Seth Forshee's avatar Seth Forshee Committed by Tim Gardner

UBUNTU: SAUCE: quota: Require that qids passed to dqget() be valid and map into s_user_ns

BugLink: http://bugs.launchpad.net/bugs/1566505

This ensures that quotas that aren't valid on disk never make it
into the hash table. inodes with ids which don't map into
s_user_ns will now have no quota enforcement.
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 60f308a4
......@@ -834,6 +834,12 @@ struct dquot *dqget(struct super_block *sb, struct kqid qid)
unsigned int hashent = hashfn(sb, qid);
struct dquot *dquot, *empty = NULL;
/* qid must be valid and must map into sb's userns */
if (!qid_valid(qid))
return ERR_PTR(-EINVAL);
if (from_kqid(sb->s_user_ns, qid) == (qid_t)-1)
return ERR_PTR(-EOVERFLOW);
if (!sb_has_quota_active(sb, qid.type))
return ERR_PTR(-ESRCH);
we_slept:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment