Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1678b191 authored by Shiraz Hashim's avatar Shiraz Hashim
Browse files

Revert "memcg: Allow non-root users permission to control memory"



This reverts commit 93d46ff4 ("memcg: Allow
non-root users permission to control memory"), as the
required function hook is already available.

Change-Id: Ia6c7da33e16a1c98534267fbce91ba3da2213ba4
Signed-off-by: default avatarShiraz Hashim <shashim@codeaurora.org>
parent 0d88d69d
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -6190,23 +6190,6 @@ static void mem_cgroup_move_task(struct cgroup_subsys_state *css,
}
#endif

static int mem_cgroup_allow_attach(struct cgroup *cgrp,
				 struct cgroup_taskset *tset)
{
	const struct cred *cred = current_cred(), *tcred;
	struct task_struct *task;

	cgroup_taskset_for_each(task, cgrp, tset) {
		tcred = __task_cred(task);

		if ((current != task) && !capable(CAP_SYS_ADMIN) &&
		    cred->euid != tcred->uid && cred->euid != tcred->suid)
			return -EACCES;
	}

	return 0;
}

/*
 * Cgroup retains root cgroups across [un]mount cycles making it necessary
 * to verify whether we're attached to the default hierarchy on each mount