Merge branch 'master' into next
James Morris [Sun, 9 Jan 2011 22:46:24 +0000 (09:46 +1100)]
Conflicts:
security/smack/smack_lsm.c

Verified and added fix by Stephen Rothwell <sfr@canb.auug.org.au>
Ok'd by Casey Schaufler <casey@schaufler-ca.com>

Signed-off-by: James Morris <jmorris@namei.org>

1  2 
MAINTAINERS
drivers/char/tpm/tpm.c
include/linux/security.h
kernel/printk.c
security/smack/smack_lsm.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
diff --cc kernel/printk.c
Simple merge
@@@ -2534,21 -2415,17 +2534,21 @@@ static int smack_setprocattr(struct tas
   * Return 0 if a subject with the smack of sock could access
   * an object with the smack of other, otherwise an error code
   */
- static int smack_unix_stream_connect(struct socket *sock,
-                                    struct socket *other, struct sock *newsk)
+ static int smack_unix_stream_connect(struct sock *sock,
+                                    struct sock *other, struct sock *newsk)
  {
-       struct socket_smack *ssp = sock->sk->sk_security;
-       struct socket_smack *osp = other->sk->sk_security;
 -      struct inode *sp = SOCK_INODE(sock->sk_socket);
 -      struct inode *op = SOCK_INODE(other->sk_socket);
++      struct socket_smack *ssp = sock->sk_security;
++      struct socket_smack *osp = other->sk_security;
        struct smk_audit_info ad;
 +      int rc = 0;
  
        smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_NET);
-       smk_ad_setfield_u_net_sk(&ad, other->sk);
+       smk_ad_setfield_u_net_sk(&ad, other);
 -      return smk_access(smk_of_inode(sp), smk_of_inode(op),
 -                               MAY_READWRITE, &ad);
 +
 +      if (!capable(CAP_MAC_OVERRIDE))
 +              rc = smk_access(ssp->smk_out, osp->smk_in, MAY_WRITE, &ad);
 +
 +      return rc;
  }
  
  /**