|
@@ -467,8 +467,7 @@ static int unix_listen(struct socket *sock, int backlog)
|
|
sk->sk_state = TCP_LISTEN;
|
|
sk->sk_state = TCP_LISTEN;
|
|
/* set credentials so connect can copy them */
|
|
/* set credentials so connect can copy them */
|
|
sk->sk_peercred.pid = task_tgid_vnr(current);
|
|
sk->sk_peercred.pid = task_tgid_vnr(current);
|
|
- sk->sk_peercred.uid = current->euid;
|
|
|
|
- sk->sk_peercred.gid = current->egid;
|
|
|
|
|
|
+ current_euid_egid(&sk->sk_peercred.uid, &sk->sk_peercred.gid);
|
|
err = 0;
|
|
err = 0;
|
|
|
|
|
|
out_unlock:
|
|
out_unlock:
|
|
@@ -1126,8 +1125,7 @@ restart:
|
|
newsk->sk_state = TCP_ESTABLISHED;
|
|
newsk->sk_state = TCP_ESTABLISHED;
|
|
newsk->sk_type = sk->sk_type;
|
|
newsk->sk_type = sk->sk_type;
|
|
newsk->sk_peercred.pid = task_tgid_vnr(current);
|
|
newsk->sk_peercred.pid = task_tgid_vnr(current);
|
|
- newsk->sk_peercred.uid = current->euid;
|
|
|
|
- newsk->sk_peercred.gid = current->egid;
|
|
|
|
|
|
+ current_euid_egid(&newsk->sk_peercred.uid, &newsk->sk_peercred.gid);
|
|
newu = unix_sk(newsk);
|
|
newu = unix_sk(newsk);
|
|
newsk->sk_sleep = &newu->peer_wait;
|
|
newsk->sk_sleep = &newu->peer_wait;
|
|
otheru = unix_sk(other);
|
|
otheru = unix_sk(other);
|
|
@@ -1187,8 +1185,9 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb)
|
|
unix_peer(ska)=skb;
|
|
unix_peer(ska)=skb;
|
|
unix_peer(skb)=ska;
|
|
unix_peer(skb)=ska;
|
|
ska->sk_peercred.pid = skb->sk_peercred.pid = task_tgid_vnr(current);
|
|
ska->sk_peercred.pid = skb->sk_peercred.pid = task_tgid_vnr(current);
|
|
- ska->sk_peercred.uid = skb->sk_peercred.uid = current->euid;
|
|
|
|
- ska->sk_peercred.gid = skb->sk_peercred.gid = current->egid;
|
|
|
|
|
|
+ current_euid_egid(&skb->sk_peercred.uid, &skb->sk_peercred.gid);
|
|
|
|
+ ska->sk_peercred.uid = skb->sk_peercred.uid;
|
|
|
|
+ ska->sk_peercred.gid = skb->sk_peercred.gid;
|
|
|
|
|
|
if (ska->sk_type != SOCK_DGRAM) {
|
|
if (ska->sk_type != SOCK_DGRAM) {
|
|
ska->sk_state = TCP_ESTABLISHED;
|
|
ska->sk_state = TCP_ESTABLISHED;
|