diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-03-18 20:03:03 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2013-03-19 19:14:52 -0400 |
commit | deb60015096102f9842b631dcad98a05001268e9 (patch) | |
tree | a4265400e5aa66fa31b24b68c8473ca1cf972acb | |
parent | d7c6797fbc2c2efa7573817685d2a76fd274d2de (diff) |
Fix broken fsys_getppid()
In particular fsys_getppid always returns the ppid in the initial pid
namespace so it does not work for a process in a pid namespace.
Fix from Eric Biederman just removes the fast system call path.
While it is a little bit sad to see another one of these bite
the dust ... I can't imagine that getppid() is really on any
real applications critical path.
Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r-- | arch/ia64/kernel/fsys.S | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index c4cd45d97749..abc6dee3799c 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S | |||
@@ -90,53 +90,6 @@ ENTRY(fsys_getpid) | |||
90 | FSYS_RETURN | 90 | FSYS_RETURN |
91 | END(fsys_getpid) | 91 | END(fsys_getpid) |
92 | 92 | ||
93 | ENTRY(fsys_getppid) | ||
94 | .prologue | ||
95 | .altrp b6 | ||
96 | .body | ||
97 | add r17=IA64_TASK_GROUP_LEADER_OFFSET,r16 | ||
98 | ;; | ||
99 | ld8 r17=[r17] // r17 = current->group_leader | ||
100 | add r9=TI_FLAGS+IA64_TASK_SIZE,r16 | ||
101 | ;; | ||
102 | |||
103 | ld4 r9=[r9] | ||
104 | add r17=IA64_TASK_REAL_PARENT_OFFSET,r17 // r17 = ¤t->group_leader->real_parent | ||
105 | ;; | ||
106 | and r9=TIF_ALLWORK_MASK,r9 | ||
107 | |||
108 | 1: ld8 r18=[r17] // r18 = current->group_leader->real_parent | ||
109 | ;; | ||
110 | cmp.ne p8,p0=0,r9 | ||
111 | add r8=IA64_TASK_TGID_OFFSET,r18 // r8 = ¤t->group_leader->real_parent->tgid | ||
112 | ;; | ||
113 | |||
114 | /* | ||
115 | * The .acq is needed to ensure that the read of tgid has returned its data before | ||
116 | * we re-check "real_parent". | ||
117 | */ | ||
118 | ld4.acq r8=[r8] // r8 = current->group_leader->real_parent->tgid | ||
119 | #ifdef CONFIG_SMP | ||
120 | /* | ||
121 | * Re-read current->group_leader->real_parent. | ||
122 | */ | ||
123 | ld8 r19=[r17] // r19 = current->group_leader->real_parent | ||
124 | (p8) br.spnt.many fsys_fallback_syscall | ||
125 | ;; | ||
126 | cmp.ne p6,p0=r18,r19 // did real_parent change? | ||
127 | mov r19=0 // i must not leak kernel bits... | ||
128 | (p6) br.cond.spnt.few 1b // yes -> redo the read of tgid and the check | ||
129 | ;; | ||
130 | mov r17=0 // i must not leak kernel bits... | ||
131 | mov r18=0 // i must not leak kernel bits... | ||
132 | #else | ||
133 | mov r17=0 // i must not leak kernel bits... | ||
134 | mov r18=0 // i must not leak kernel bits... | ||
135 | mov r19=0 // i must not leak kernel bits... | ||
136 | #endif | ||
137 | FSYS_RETURN | ||
138 | END(fsys_getppid) | ||
139 | |||
140 | ENTRY(fsys_set_tid_address) | 93 | ENTRY(fsys_set_tid_address) |
141 | .prologue | 94 | .prologue |
142 | .altrp b6 | 95 | .altrp b6 |
@@ -614,7 +567,7 @@ paravirt_fsyscall_table: | |||
614 | data8 0 // chown | 567 | data8 0 // chown |
615 | data8 0 // lseek // 1040 | 568 | data8 0 // lseek // 1040 |
616 | data8 fsys_getpid // getpid | 569 | data8 fsys_getpid // getpid |
617 | data8 fsys_getppid // getppid | 570 | data8 0 // getppid |
618 | data8 0 // mount | 571 | data8 0 // mount |
619 | data8 0 // umount | 572 | data8 0 // umount |
620 | data8 0 // setuid // 1045 | 573 | data8 0 // setuid // 1045 |