]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - security/security.c
LSM: general protection fault in legacy_parse_param
[mirror_ubuntu-jammy-kernel.git] / security / security.c
index 07a32ed3fc9f55ca99291f3d81be2d98588cd5b5..b153316c234ef33783996759c2c7e2d88b4e9ec3 100644 (file)
@@ -1054,9 +1054,22 @@ int security_fs_context_dup(struct fs_context *fc, struct fs_context *src_fc)
        return call_int_hook(fs_context_dup, 0, fc, src_fc);
 }
 
-int security_fs_context_parse_param(struct fs_context *fc, struct fs_parameter *param)
+int security_fs_context_parse_param(struct fs_context *fc,
+                                   struct fs_parameter *param)
 {
-       return call_int_hook(fs_context_parse_param, -ENOPARAM, fc, param);
+       struct security_hook_list *hp;
+       int trc;
+       int rc = -ENOPARAM;
+
+       hlist_for_each_entry(hp, &security_hook_heads.fs_context_parse_param,
+                            list) {
+               trc = hp->hook.fs_context_parse_param(fc, param);
+               if (trc == 0)
+                       rc = 0;
+               else if (trc != -ENOPARAM)
+                       return trc;
+       }
+       return rc;
 }
 
 int security_sb_alloc(struct super_block *sb)