Commit 887493aa authored by Luis Henriques's avatar Luis Henriques

Revert "(namespace) Revert "UBUNTU: SAUCE: quota: Require that qids passed to...

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

BugLink: https://bugs.launchpad.net/bugs/1644165

This reverts commit 70c252de.

The kernel fix for bug #1634964 breaks LXD userspace, in particular the
following commits:

ac7f3f73 (namespace) vfs: Don't modify inodes with a uid or gid unknown to the vfs
ca52383a (namespace) vfs: Don't create inodes with a uid or gid unknown to the vfs

LXD 2.0.6 will include changes to support these kernel changes, but it isn't
available yet on xenial, so for now we just revert these commits.
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 8010267b
...@@ -834,6 +834,12 @@ struct dquot *dqget(struct super_block *sb, struct kqid qid) ...@@ -834,6 +834,12 @@ struct dquot *dqget(struct super_block *sb, struct kqid qid)
unsigned int hashent = hashfn(sb, qid); unsigned int hashent = hashfn(sb, qid);
struct dquot *dquot, *empty = NULL; 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)) if (!sb_has_quota_active(sb, qid.type))
return ERR_PTR(-ESRCH); return ERR_PTR(-ESRCH);
we_slept: 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