aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf_fdpic.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
-rw-r--r--fs/binfmt_elf_fdpic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 1f6e8c023b4c..45dabd59936f 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -1414,6 +1414,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
1414static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, 1414static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
1415 struct mm_struct *mm) 1415 struct mm_struct *mm)
1416{ 1416{
1417 const struct cred *cred;
1417 unsigned int i, len; 1418 unsigned int i, len;
1418 1419
1419 /* first copy the parameters from user space */ 1420 /* first copy the parameters from user space */
@@ -1441,8 +1442,11 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
1441 psinfo->pr_zomb = psinfo->pr_sname == 'Z'; 1442 psinfo->pr_zomb = psinfo->pr_sname == 'Z';
1442 psinfo->pr_nice = task_nice(p); 1443 psinfo->pr_nice = task_nice(p);
1443 psinfo->pr_flag = p->flags; 1444 psinfo->pr_flag = p->flags;
1444 SET_UID(psinfo->pr_uid, p->cred->uid); 1445 rcu_read_lock();
1445 SET_GID(psinfo->pr_gid, p->cred->gid); 1446 cred = __task_cred(p);
1447 SET_UID(psinfo->pr_uid, cred->uid);
1448 SET_GID(psinfo->pr_gid, cred->gid);
1449 rcu_read_unlock();
1446 strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname)); 1450 strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname));
1447 1451
1448 return 0; 1452 return 0;