apparmor: fix overlapping attachment computation
[linux-2.6-microblaze.git] / security / apparmor / domain.c
index d71023f..91689d3 100644 (file)
@@ -466,7 +466,7 @@ restart:
                                 * xattrs, or a longer match
                                 */
                                candidate = profile;
-                               candidate_len = profile->xmatch_len;
+                               candidate_len = max(count, profile->xmatch_len);
                                candidate_xattrs = ret;
                                conflict = false;
                        }