Commit 84d7ed79 authored by Oleg Nesterov's avatar Oleg Nesterov

uprobes/tracing: Fix dentry/mount leak in create_trace_uprobe()

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: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
parent e8440c14
...@@ -253,16 +253,18 @@ static int create_trace_uprobe(int argc, char **argv) ...@@ -253,16 +253,18 @@ static int create_trace_uprobe(int argc, char **argv)
if (ret) if (ret)
goto fail_address_parse; goto fail_address_parse;
ret = kstrtoul(arg, 0, &offset);
if (ret)
goto fail_address_parse;
inode = igrab(path.dentry->d_inode); inode = igrab(path.dentry->d_inode);
path_put(&path);
if (!S_ISREG(inode->i_mode)) { if (!S_ISREG(inode->i_mode)) {
ret = -EINVAL; ret = -EINVAL;
goto fail_address_parse; goto fail_address_parse;
} }
ret = kstrtoul(arg, 0, &offset);
if (ret)
goto fail_address_parse;
argc -= 2; argc -= 2;
argv += 2; argv += 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment