aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 92f52abd3515..c6250d0055d2 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -470,8 +470,7 @@ static int unix_listen(struct socket *sock, int backlog)
470 sk->sk_state = TCP_LISTEN; 470 sk->sk_state = TCP_LISTEN;
471 /* set credentials so connect can copy them */ 471 /* set credentials so connect can copy them */
472 sk->sk_peercred.pid = task_tgid_vnr(current); 472 sk->sk_peercred.pid = task_tgid_vnr(current);
473 sk->sk_peercred.uid = current->euid; 473 current_euid_egid(&sk->sk_peercred.uid, &sk->sk_peercred.gid);
474 sk->sk_peercred.gid = current->egid;
475 err = 0; 474 err = 0;
476 475
477out_unlock: 476out_unlock:
@@ -1134,8 +1133,7 @@ restart:
1134 newsk->sk_state = TCP_ESTABLISHED; 1133 newsk->sk_state = TCP_ESTABLISHED;
1135 newsk->sk_type = sk->sk_type; 1134 newsk->sk_type = sk->sk_type;
1136 newsk->sk_peercred.pid = task_tgid_vnr(current); 1135 newsk->sk_peercred.pid = task_tgid_vnr(current);
1137 newsk->sk_peercred.uid = current->euid; 1136 current_euid_egid(&newsk->sk_peercred.uid, &newsk->sk_peercred.gid);
1138 newsk->sk_peercred.gid = current->egid;
1139 newu = unix_sk(newsk); 1137 newu = unix_sk(newsk);
1140 newsk->sk_sleep = &newu->peer_wait; 1138 newsk->sk_sleep = &newu->peer_wait;
1141 otheru = unix_sk(other); 1139 otheru = unix_sk(other);
@@ -1195,8 +1193,9 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb)
1195 unix_peer(ska) = skb; 1193 unix_peer(ska) = skb;
1196 unix_peer(skb) = ska; 1194 unix_peer(skb) = ska;
1197 ska->sk_peercred.pid = skb->sk_peercred.pid = task_tgid_vnr(current); 1195 ska->sk_peercred.pid = skb->sk_peercred.pid = task_tgid_vnr(current);
1198 ska->sk_peercred.uid = skb->sk_peercred.uid = current->euid; 1196 current_euid_egid(&skb->sk_peercred.uid, &skb->sk_peercred.gid);
1199 ska->sk_peercred.gid = skb->sk_peercred.gid = current->egid; 1197 ska->sk_peercred.uid = skb->sk_peercred.uid;
1198 ska->sk_peercred.gid = skb->sk_peercred.gid;
1200 1199
1201 if (ska->sk_type != SOCK_DGRAM) { 1200 if (ska->sk_type != SOCK_DGRAM) {
1202 ska->sk_state = TCP_ESTABLISHED; 1201 ska->sk_state = TCP_ESTABLISHED;