Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux-2.6-microblaze.git] / security / security.c
index 5dce670..ab4f963 100644 (file)
@@ -118,6 +118,8 @@ static int lsm_append(char *new, char **result)
 
        if (*result == NULL) {
                *result = kstrdup(new, GFP_KERNEL);
+               if (*result == NULL)
+                       return -ENOMEM;
        } else {
                /* Check if it is the last registered name */
                if (match_last_lsm(*result, new))
@@ -1056,6 +1058,17 @@ int security_kernel_post_read_file(struct file *file, char *buf, loff_t size,
 }
 EXPORT_SYMBOL_GPL(security_kernel_post_read_file);
 
+int security_kernel_load_data(enum kernel_load_data_id id)
+{
+       int ret;
+
+       ret = call_int_hook(kernel_load_data, 0, id);
+       if (ret)
+               return ret;
+       return ima_load_data(id);
+}
+EXPORT_SYMBOL_GPL(security_kernel_load_data);
+
 int security_task_fix_setuid(struct cred *new, const struct cred *old,
                             int flags)
 {