Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec...
[firefly-linux-kernel-4.4.55.git] / security / selinux / avc.c
index 3d2715fd35ea4c8dc11b580a7ee1fb946b9c4257..d515b2128a4ef6f631f4113cf0fcf3575fea3e6d 100644 (file)
@@ -526,7 +526,7 @@ int avc_audit(u32 ssid, u32 tsid,
         * during retry. However this is logically just as if the operation
         * happened a little later.
         */
-       if ((a->type == LSM_AUDIT_DATA_FS) &&
+       if ((a->type == LSM_AUDIT_DATA_INODE) &&
            (flags & IPERM_FLAG_RCU))
                return -ECHILD;
 
@@ -752,10 +752,9 @@ int avc_ss_reset(u32 seqno)
 int avc_has_perm_noaudit(u32 ssid, u32 tsid,
                         u16 tclass, u32 requested,
                         unsigned flags,
-                        struct av_decision *in_avd)
+                        struct av_decision *avd)
 {
        struct avc_node *node;
-       struct av_decision avd_entry, *avd;
        int rc = 0;
        u32 denied;
 
@@ -766,18 +765,11 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid,
        node = avc_lookup(ssid, tsid, tclass);
        if (unlikely(!node)) {
                rcu_read_unlock();
-
-               if (in_avd)
-                       avd = in_avd;
-               else
-                       avd = &avd_entry;
-
                security_compute_av(ssid, tsid, tclass, avd);
                rcu_read_lock();
                node = avc_insert(ssid, tsid, tclass, avd);
        } else {
-               if (in_avd)
-                       memcpy(in_avd, &node->ae.avd, sizeof(*in_avd));
+               memcpy(avd, &node->ae.avd, sizeof(*avd));
                avd = &node->ae.avd;
        }