aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2015-04-15 00:40:21 +0530
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-09-27 02:50:40 +0200
commit6ceb62d16e3ee285bccb7e355596e508639bd2f9 (patch)
tree1d69780e13dee1a81c9a1d11df97852dbf21572a
parent924266fd94bb97a2a8786fe2b4592924ec01aa1d (diff)
downloadkernel_i9300_mainline-6ceb62d16e3ee285bccb7e355596e508639bd2f9.zip
kernel_i9300_mainline-6ceb62d16e3ee285bccb7e355596e508639bd2f9.tar.gz
kernel_i9300_mainline-6ceb62d16e3ee285bccb7e355596e508639bd2f9.tar.bz2
proc: uid_cputime: create uids from kuids
Create uids from kuids using from_kuid_munged(), otherwise we run into following build error and warnings: -------------------- CC drivers/misc/uid_cputime.o drivers/misc/uid_cputime.c: In function ‘uid_stat_show’: drivers/misc/uid_cputime.c:90:36: error: incompatible type for argument 1 of ‘find_or_register_uid’ drivers/misc/uid_cputime.c:54:26: note: expected ‘uid_t’ but argument is of type ‘kuid_t’ drivers/misc/uid_cputime.c:94:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘kuid_t’ [-Wformat] drivers/misc/uid_cputime.c: In function ‘process_notifier’: drivers/misc/uid_cputime.c:194:6: error: incompatible types when assigning to type ‘uid_t’ from type ‘kuid_t’ make[2]: *** [drivers/misc/uid_cputime.o] Error 1 -------------------- Change-Id: Ifecb98001f7fe2fac74d1ef3e1abd03d43fc9059 Signed-off-by: Amit Pundir <amit.pundir@linaro.org> (cherry picked from commit b0f4decae627cf2d74e6f72c7ecb939c77d48625)
-rw-r--r--drivers/misc/uid_cputime.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/misc/uid_cputime.c b/drivers/misc/uid_cputime.c
index cb26e3c..acd7046 100644
--- a/drivers/misc/uid_cputime.c
+++ b/drivers/misc/uid_cputime.c
@@ -87,12 +87,14 @@ static int uid_stat_show(struct seq_file *m, void *v)
read_lock(&tasklist_lock);
for_each_process(task) {
- uid_entry = find_or_register_uid(task_uid(task));
+ uid_entry = find_or_register_uid(from_kuid_munged(
+ current_user_ns(), task_uid(task)));
if (!uid_entry) {
read_unlock(&tasklist_lock);
mutex_unlock(&uid_lock);
pr_err("%s: failed to find the uid_entry for uid %d\n",
- __func__, task_uid(task));
+ __func__, from_kuid_munged(current_user_ns(),
+ task_uid(task)));
return -ENOMEM;
}
task_cputime_adjusted(task, &utime, &stime);
@@ -191,7 +193,7 @@ static int process_notifier(struct notifier_block *self,
return NOTIFY_OK;
mutex_lock(&uid_lock);
- uid = task_uid(task);
+ uid = from_kuid_munged(current_user_ns(), task_uid(task));
uid_entry = find_or_register_uid(uid);
if (!uid_entry) {
pr_err("%s: failed to find uid %d\n", __func__, uid);