aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/af_unix.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-06-12 23:34:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-16 17:58:16 -0400
commit7361c36c5224519b258219fe3d0e8abc865d8134 (patch)
tree7987367633b4729dff0afa2180862a2ce919f3cb /include/net/af_unix.h
parent257b5358b32f17e0603b6ff57b13610b0e02348f (diff)
af_unix: Allow credentials to work across user and pid namespaces.
In unix_skb_parms store pointers to struct pid and struct cred instead of raw uid, gid, and pid values, then translate the credentials on reception into values that are meaningful in the receiving processes namespaces. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/af_unix.h')
-rw-r--r--include/net/af_unix.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 20725e213aee..90c9e2872f27 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -23,7 +23,8 @@ struct unix_address {
23}; 23};
24 24
25struct unix_skb_parms { 25struct unix_skb_parms {
26 struct ucred creds; /* Skb credentials */ 26 struct pid *pid; /* Skb credentials */
27 const struct cred *cred;
27 struct scm_fp_list *fp; /* Passed files */ 28 struct scm_fp_list *fp; /* Passed files */
28#ifdef CONFIG_SECURITY_NETWORK 29#ifdef CONFIG_SECURITY_NETWORK
29 u32 secid; /* Security ID */ 30 u32 secid; /* Security ID */
@@ -31,7 +32,6 @@ struct unix_skb_parms {
31}; 32};
32 33
33#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) 34#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
34#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
35#define UNIXSID(skb) (&UNIXCB((skb)).secid) 35#define UNIXSID(skb) (&UNIXCB((skb)).secid)
36 36
37#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock) 37#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)