]> Pileus Git - ~andy/linux/blobdiff - security/apparmor/lsm.c
LSM: do not initialize common_audit_data to 0
[~andy/linux] / security / apparmor / lsm.c
index 97ce8fae49b3bd063a78fd5d9a6cc3eb80254cf1..032daab449b0bb3007562e795593a15d247a2c58 100644 (file)
@@ -373,7 +373,7 @@ static int apparmor_inode_getattr(struct vfsmount *mnt, struct dentry *dentry)
                                      AA_MAY_META_READ);
 }
 
-static int apparmor_dentry_open(struct file *file, const struct cred *cred)
+static int apparmor_file_open(struct file *file, const struct cred *cred)
 {
        struct aa_file_cxt *fcxt = file->f_security;
        struct aa_profile *profile;
@@ -588,10 +588,12 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,
                        error = aa_setprocattr_permipc(args);
                } else {
                        struct common_audit_data sa;
-                       COMMON_AUDIT_DATA_INIT(&sa, NONE);
-                       sa.aad.op = OP_SETPROCATTR;
-                       sa.aad.info = name;
-                       sa.aad.error = -EINVAL;
+                       struct apparmor_audit_data aad = {0,};
+                       sa.type = LSM_AUDIT_DATA_NONE;
+                       sa.aad = &aad;
+                       aad.op = OP_SETPROCATTR;
+                       aad.info = name;
+                       aad.error = -EINVAL;
                        return aa_audit(AUDIT_APPARMOR_DENIED,
                                        __aa_current_profile(), GFP_KERNEL,
                                        &sa, NULL);
@@ -638,9 +640,9 @@ static struct security_operations apparmor_ops = {
        .path_chmod =                   apparmor_path_chmod,
        .path_chown =                   apparmor_path_chown,
        .path_truncate =                apparmor_path_truncate,
-       .dentry_open =                  apparmor_dentry_open,
        .inode_getattr =                apparmor_inode_getattr,
 
+       .file_open =                    apparmor_file_open,
        .file_permission =              apparmor_file_permission,
        .file_alloc_security =          apparmor_file_alloc_security,
        .file_free_security =           apparmor_file_free_security,