diff options
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 89335723fb2a..287b3d381174 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1877,12 +1877,18 @@ void __audit_inode(struct filename *name, const struct dentry *dentry, | |||
1877 | } | 1877 | } |
1878 | 1878 | ||
1879 | out_alloc: | 1879 | out_alloc: |
1880 | /* unable to find the name from a previous getname(). Allocate a new | 1880 | /* unable to find an entry with both a matching name and type */ |
1881 | * anonymous entry. | 1881 | n = audit_alloc_name(context, AUDIT_TYPE_UNKNOWN); |
1882 | */ | ||
1883 | n = audit_alloc_name(context, AUDIT_TYPE_NORMAL); | ||
1884 | if (!n) | 1882 | if (!n) |
1885 | return; | 1883 | return; |
1884 | if (name) | ||
1885 | /* since name is not NULL we know there is already a matching | ||
1886 | * name record, see audit_getname(), so there must be a type | ||
1887 | * mismatch; reuse the string path since the original name | ||
1888 | * record will keep the string valid until we free it in | ||
1889 | * audit_free_names() */ | ||
1890 | n->name = name; | ||
1891 | |||
1886 | out: | 1892 | out: |
1887 | if (parent) { | 1893 | if (parent) { |
1888 | n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL; | 1894 | n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL; |