Merge branch 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[linux-2.6-microblaze.git] / security / security.c
index 259b8e7..11c1a7d 100644 (file)
@@ -1970,8 +1970,20 @@ EXPORT_SYMBOL(security_ismaclabel);
 
 int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
 {
-       return call_int_hook(secid_to_secctx, -EOPNOTSUPP, secid, secdata,
-                               seclen);
+       struct security_hook_list *hp;
+       int rc;
+
+       /*
+        * Currently, only one LSM can implement secid_to_secctx (i.e this
+        * LSM hook is not "stackable").
+        */
+       hlist_for_each_entry(hp, &security_hook_heads.secid_to_secctx, list) {
+               rc = hp->hook.secid_to_secctx(secid, secdata, seclen);
+               if (rc != LSM_RET_DEFAULT(secid_to_secctx))
+                       return rc;
+       }
+
+       return LSM_RET_DEFAULT(secid_to_secctx);
 }
 EXPORT_SYMBOL(security_secid_to_secctx);