aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 19a385e9968e..d41e24d6ae41 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4468,11 +4468,12 @@ static void selinux_d_instantiate (struct dentry *dentry, struct inode *inode)
4468} 4468}
4469 4469
4470static int selinux_getprocattr(struct task_struct *p, 4470static int selinux_getprocattr(struct task_struct *p,
4471 char *name, void *value, size_t size) 4471 char *name, char **value)
4472{ 4472{
4473 struct task_security_struct *tsec; 4473 struct task_security_struct *tsec;
4474 u32 sid; 4474 u32 sid;
4475 int error; 4475 int error;
4476 unsigned len;
4476 4477
4477 if (current != p) { 4478 if (current != p) {
4478 error = task_has_perm(current, p, PROCESS__GETATTR); 4479 error = task_has_perm(current, p, PROCESS__GETATTR);
@@ -4500,7 +4501,10 @@ static int selinux_getprocattr(struct task_struct *p,
4500 if (!sid) 4501 if (!sid)
4501 return 0; 4502 return 0;
4502 4503
4503 return selinux_getsecurity(sid, value, size); 4504 error = security_sid_to_context(sid, value, &len);
4505 if (error)
4506 return error;
4507 return len;
4504} 4508}
4505 4509
4506static int selinux_setprocattr(struct task_struct *p, 4510static int selinux_setprocattr(struct task_struct *p,