selinux: libsepol: remove dead code in check_avtab_hierarchy_callback()
[safe/jmp/linux-2.6] / security / smack / smack_lsm.c
index 0b3bb64..a5721b3 100644 (file)
 #include <net/netlabel.h>
 #include <net/cipso_ipv4.h>
 #include <linux/audit.h>
+#include <linux/magic.h>
 #include "smack.h"
 
 #define task_security(task)    (task_cred_xxx((task), security))
 
-/*
- * I hope these are the hokeyist lines of code in the module. Casey.
- */
-#define DEVPTS_SUPER_MAGIC     0x1cd1
-#define SOCKFS_MAGIC           0x534F434B
-#define TMPFS_MAGIC            0x01021994
-
 /**
  * smk_fetch - Fetch the smack label from a file.
  * @ip: a pointer to the inode
@@ -163,12 +157,12 @@ static int smack_ptrace_traceme(struct task_struct *ptp)
  *
  * Returns 0 on success, error code otherwise.
  */
-static int smack_syslog(int type)
+static int smack_syslog(int type, bool from_file)
 {
        int rc;
        char *sp = current_security();
 
-       rc = cap_syslog(type);
+       rc = cap_syslog(type, from_file);
        if (rc != 0)
                return rc;
 
@@ -1666,6 +1660,7 @@ static int smack_inode_setsecurity(struct inode *inode, const char *name,
 
        if (strcmp(name, XATTR_SMACK_SUFFIX) == 0) {
                nsp->smk_inode = sp;
+               nsp->smk_flags |= SMK_INODE_INSTANT;
                return 0;
        }
        /*
@@ -2607,7 +2602,7 @@ static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 #ifdef CONFIG_AUDIT
        smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_NET);
        ad.a.u.net.family = sk->sk_family;
-       ad.a.u.net.netif = skb->iif;
+       ad.a.u.net.netif = skb->skb_iif;
        ipv4_skb_to_auditdata(skb, &ad.a, NULL);
 #endif
        /*
@@ -2762,7 +2757,7 @@ static int smack_inet_conn_request(struct sock *sk, struct sk_buff *skb,
 #ifdef CONFIG_AUDIT
        smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_NET);
        ad.a.u.net.family = family;
-       ad.a.u.net.netif = skb->iif;
+       ad.a.u.net.netif = skb->skb_iif;
        ipv4_skb_to_auditdata(skb, &ad.a, NULL);
 #endif
        /*