summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-10-10 21:25:28 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-13 02:15:08 +0200
commit7ac86265dc8f665cc49d6e60a125e608cd2fca14 (patch)
tree9e7941e2d8dfb2106c5fb28504531dafc72e14e6 /fs/namei.c
parentvfs: define struct filename and have getname() return it (diff)
downloadlinux-7ac86265dc8f665cc49d6e60a125e608cd2fca14.tar.xz
linux-7ac86265dc8f665cc49d6e60a125e608cd2fca14.zip
audit: allow audit code to satisfy getname requests from its names_list
Currently, if we call getname() on a userland string more than once, we'll get multiple copies of the string and multiple audit_names records. Add a function that will allow the audit_names code to satisfy getname requests using info from the audit_names list, avoiding a new allocation and audit_names records. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index ec638d27642f..5dbc3f836934 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -130,6 +130,10 @@ getname_flags(const char __user *filename, int flags, int *empty)
char *kname;
int len;
+ result = audit_reusename(filename);
+ if (result)
+ return result;
+
/* FIXME: create dedicated slabcache? */
result = kzalloc(sizeof(*result), GFP_KERNEL);
if (unlikely(!result))