aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-03-13 19:04:35 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-05-15 17:59:24 -0400
commit54ba47edac90091d42e5f97516cad56953576a5a (patch)
tree6c0931ece1c5d72a86ee4022d74ba8c384719afb /kernel/signal.c
parent65cc5a17ad3388f89ddc3d68226a09242656809b (diff)
userns: signal remove unnecessary map_cred_ns
map_cred_ns is a light wrapper around from_kuid with the order of the arguments reversed. Replace map_cred_ns with from_kuid and remove map_cred_ns. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index aef629c65c87..833ea5166855 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1019,15 +1019,6 @@ static inline int legacy_queue(struct sigpending *signals, int sig)
1019 return (sig < SIGRTMIN) && sigismember(&signals->signal, sig); 1019 return (sig < SIGRTMIN) && sigismember(&signals->signal, sig);
1020} 1020}
1021 1021
1022/*
1023 * map the uid in struct cred into user namespace *ns
1024 */
1025static inline uid_t map_cred_ns(const struct cred *cred,
1026 struct user_namespace *ns)
1027{
1028 return from_kuid_munged(ns, cred->uid);
1029}
1030
1031#ifdef CONFIG_USER_NS 1022#ifdef CONFIG_USER_NS
1032static inline void userns_fixup_signal_uid(struct siginfo *info, struct task_struct *t) 1023static inline void userns_fixup_signal_uid(struct siginfo *info, struct task_struct *t)
1033{ 1024{
@@ -1677,8 +1668,8 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
1677 */ 1668 */
1678 rcu_read_lock(); 1669 rcu_read_lock();
1679 info.si_pid = task_pid_nr_ns(tsk, tsk->parent->nsproxy->pid_ns); 1670 info.si_pid = task_pid_nr_ns(tsk, tsk->parent->nsproxy->pid_ns);
1680 info.si_uid = map_cred_ns(__task_cred(tsk), 1671 info.si_uid = from_kuid_munged(task_cred_xxx(tsk->parent, user_ns),
1681 task_cred_xxx(tsk->parent, user_ns)); 1672 task_uid(tsk));
1682 rcu_read_unlock(); 1673 rcu_read_unlock();
1683 1674
1684 info.si_utime = cputime_to_clock_t(tsk->utime + tsk->signal->utime); 1675 info.si_utime = cputime_to_clock_t(tsk->utime + tsk->signal->utime);
@@ -1761,8 +1752,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
1761 */ 1752 */
1762 rcu_read_lock(); 1753 rcu_read_lock();
1763 info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns); 1754 info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
1764 info.si_uid = map_cred_ns(__task_cred(tsk), 1755 info.si_uid = from_kuid_munged(task_cred_xxx(parent, user_ns), task_uid(tsk));
1765 task_cred_xxx(parent, user_ns));
1766 rcu_read_unlock(); 1756 rcu_read_unlock();
1767 1757
1768 info.si_utime = cputime_to_clock_t(tsk->utime); 1758 info.si_utime = cputime_to_clock_t(tsk->utime);
@@ -2180,8 +2170,8 @@ static int ptrace_signal(int signr, siginfo_t *info,
2180 info->si_code = SI_USER; 2170 info->si_code = SI_USER;
2181 rcu_read_lock(); 2171 rcu_read_lock();
2182 info->si_pid = task_pid_vnr(current->parent); 2172 info->si_pid = task_pid_vnr(current->parent);
2183 info->si_uid = map_cred_ns(__task_cred(current->parent), 2173 info->si_uid = from_kuid_munged(current_user_ns(),
2184 current_user_ns()); 2174 task_uid(current->parent));
2185 rcu_read_unlock(); 2175 rcu_read_unlock();
2186 } 2176 }
2187 2177