diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2010-06-12 23:30:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-16 17:55:55 -0400 |
commit | 109f6e39fa07c48f580125f531f46cb7c245b528 (patch) | |
tree | 9ec97679c227394a44ebede5768f92d970cea6eb /include/net/sock.h | |
parent | 3f551f9436c05a3b5eccdd6e94733df5bb98d2a5 (diff) |
af_unix: Allow SO_PEERCRED to work across namespaces.
Use struct pid and struct cred to store the peer credentials on struct
sock. This gives enough information to convert the peer credential
information to a value relative to whatever namespace the socket is in
at the time.
This removes nasty surprises when using SO_PEERCRED on socket
connetions where the processes on either side are in different pid and
user namespaces.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index f8acf38f092f..4f26f2f83be9 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -295,7 +295,8 @@ struct sock { | |||
295 | unsigned short sk_ack_backlog; | 295 | unsigned short sk_ack_backlog; |
296 | unsigned short sk_max_ack_backlog; | 296 | unsigned short sk_max_ack_backlog; |
297 | __u32 sk_priority; | 297 | __u32 sk_priority; |
298 | struct ucred sk_peercred; | 298 | struct pid *sk_peer_pid; |
299 | const struct cred *sk_peer_cred; | ||
299 | long sk_rcvtimeo; | 300 | long sk_rcvtimeo; |
300 | long sk_sndtimeo; | 301 | long sk_sndtimeo; |
301 | struct sk_filter *sk_filter; | 302 | struct sk_filter *sk_filter; |