X-Git-Url: http://git.cascardo.info/?p=cascardo%2Flinux.git;a=blobdiff_plain;f=kernel%2Fauditsc.c;h=37c69ab561dad881c9fd76eaac1ed5b48e5bab52;hp=c75522a83678d14d542f0e1b25a13180762803ca;hb=66b3f4f0a0fcc197a1e432c3d2134f5c6a5275b9;hpb=8f4385d590d4296ec38e228d17b1d002f6031dd2 diff --git a/kernel/auditsc.c b/kernel/auditsc.c index c75522a83678..37c69ab561da 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1877,12 +1877,18 @@ void __audit_inode(struct filename *name, const struct dentry *dentry, } out_alloc: - /* unable to find the name from a previous getname(). Allocate a new - * anonymous entry. - */ - n = audit_alloc_name(context, AUDIT_TYPE_NORMAL); + /* unable to find an entry with both a matching name and type */ + n = audit_alloc_name(context, AUDIT_TYPE_UNKNOWN); if (!n) return; + if (name) + /* since name is not NULL we know there is already a matching + * name record, see audit_getname(), so there must be a type + * mismatch; reuse the string path since the original name + * record will keep the string valid until we free it in + * audit_free_names() */ + n->name = name; + out: if (parent) { n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL;