From b39716c0269eca6a3fa2aa5b99b83b0ad0a456bc Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 7 Jun 2012 14:21:12 -0700 Subject: [PATCH] --- yaml --- r: 310550 b: refs/heads/master c: 300f786b2683f8bb1ec0afb6e1851183a479c86d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/prctl.h | 10 ++++++---- trunk/kernel/sys.c | 13 +++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 7a6524d87060..fa184c680fa9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1ad75b9e16280ca4e2501a629a225319cf2eef2e +refs/heads/master: 300f786b2683f8bb1ec0afb6e1851183a479c86d diff --git a/trunk/include/linux/prctl.h b/trunk/include/linux/prctl.h index 711e0a30aacc..3988012255dc 100644 --- a/trunk/include/linux/prctl.h +++ b/trunk/include/linux/prctl.h @@ -127,8 +127,8 @@ #define PR_SET_PTRACER 0x59616d61 # define PR_SET_PTRACER_ANY ((unsigned long)-1) -#define PR_SET_CHILD_SUBREAPER 36 -#define PR_GET_CHILD_SUBREAPER 37 +#define PR_SET_CHILD_SUBREAPER 36 +#define PR_GET_CHILD_SUBREAPER 37 /* * If no_new_privs is set, then operations that grant new privileges (i.e. @@ -142,7 +142,9 @@ * asking selinux for a specific new context (e.g. with runcon) will result * in execve returning -EPERM. */ -#define PR_SET_NO_NEW_PRIVS 38 -#define PR_GET_NO_NEW_PRIVS 39 +#define PR_SET_NO_NEW_PRIVS 38 +#define PR_GET_NO_NEW_PRIVS 39 + +#define PR_GET_TID_ADDRESS 40 #endif /* _LINUX_PRCTL_H */ diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index 19a2c7139960..0ec1942ba7ea 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -1988,12 +1988,22 @@ static int prctl_set_mm(int opt, unsigned long addr, up_read(&mm->mmap_sem); return error; } + +static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr) +{ + return put_user(me->clear_child_tid, tid_addr); +} + #else /* CONFIG_CHECKPOINT_RESTORE */ static int prctl_set_mm(int opt, unsigned long addr, unsigned long arg4, unsigned long arg5) { return -EINVAL; } +static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr) +{ + return -EINVAL; +} #endif SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, @@ -2131,6 +2141,9 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, else return -EINVAL; break; + case PR_GET_TID_ADDRESS: + error = prctl_get_tid_address(me, (int __user **)arg2); + break; default: return -EINVAL; }