[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120717105936.GC28744@somewhere>
Date: Tue, 17 Jul 2012 12:59:39 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Jovi Zhang <bookjovi@...il.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: uprobe: checking probe event include directory
On Tue, Jul 17, 2012 at 06:12:28PM +0800, Jovi Zhang wrote:
> From 16ed13ee9098ae01705e8456005d1ad6d9909128 Mon Sep 17 00:00:00 2001
> From: Jovi Zhang <bookjovi@...il.com>
> Date: Wed, 18 Jul 2012 01:16:23 +0800
> Subject: [PATCH] uprobe: checking probe event include directory
>
> Currently below command run successful:
> $ echo 'p /bin:0x4245c0' > /sys/kernel/debug/tracing/uprobe_events
>
> this don't make sense, because /bin is a directory,
> so make this checking earily, not report error untill probe enable.
>
> Signed-off-by: Jovi Zhang <bookjovi@...il.com>
Adding Srikar in Cc.
> ---
> kernel/trace/trace_uprobe.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
> index 85158fa..cf382de 100644
> --- a/kernel/trace/trace_uprobe.c
> +++ b/kernel/trace/trace_uprobe.c
> @@ -259,6 +259,11 @@ static int create_trace_uprobe(int argc, char **argv)
> goto fail_address_parse;
>
> inode = igrab(path.dentry->d_inode);
> + if (S_ISDIR(inode->i_mode)) {
> + ret = -EINVAL;
> + pr_info("probe file cannot be directory.\n");
> + goto fail_address_parse;
> + }
>
> argc -= 2;
> argv += 2;
> --
> 1.7.9.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists