[PATCH 1/6] uprobes/tracing: Fix dentry/mount leak in create_trace_uprobe()

Oleg Nesterov
2013-01-31T19:19:48Z

create_trace_uprobe() does kern_path() to find ->d_inode, but forgets
to do path_put(). We can do this right after igrab().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
kernel/trace/trace_uprobe.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 7d5b407..6563f00 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -253,12 +253,13 @@ static int create_trace_uprobe(int argc, char **argv)
if (ret)
goto fail_address_parse;

+ inode = igrab(path.dentry->d_inode);
+ path_put(&path);
+
ret = kstrtoul(arg, 0, &offset);
if (ret)
goto fail_address_parse;

- inode = igrab(path.dentry->d_inode);
-
argc -= 2;
argv += 2;

--
1.5.5.1