lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 19 Jul 2009 21:32:25 -0400
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Li Zefan <lizf@...fujitsu.com>
Cc:	Jiri Olsa <jolsa@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	Steven Rostedt <rostedt@...dmis.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: dont reset set_ftrace_filter/notrace when
	opened with r/w perm

On Mon, Jul 20, 2009 at 08:55:54AM +0800, Li Zefan wrote:
> Jiri Olsa wrote:
> > On Fri, Jul 17, 2009 at 05:37:24PM +0800, Li Zefan wrote:
> >> Jiri Olsa wrote:
> >>> If user setup set_ftrace_filter/set_ftrace_notrace files and then opens them
> >>> with read&write permissions, the previous setup will be removed.
> >>>
> >> Currently:
> >>
> >>  # echo 'sys_open sys_close' > set_ftrace_filter
> >>  # cat set_ftrace_filter
> >>  sys_open
> >>  sys_close
> >>
> >> After your patch:
> >>
> >>  # echo 'sys_open sys_close' > set_ftrace_filter
> >>  # cat set_ftrace_filter
> >>  sys_close
> >>
> > 
> > oops, sry I missed this..
> > 
> > Following patch adds new FTRACE_ITER_RESET flag, as the decision needs
> > to be taken in "open" and applied in "write".  I'm not sure whats the
> > policy for adding new flags, but it looks ok to me.
> > 
> 
> I have no strong opinion whether to do the reset in "open" or in first
> "write".
> 
> All said, I think this is cleaner, without introducing a new flag:
> 
> @@ -2260,6 +2256,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
>  		return 0;
>  
>  	mutex_lock(&ftrace_regex_lock);
> +	if (file->f_pos == 0 &&
> +	    (file->f_mode & FMODE_WRITE) && !(file->f_flags & O_APPEND))
> +		ftrace_filter_reset(enable);
>  
>  	if (file->f_mode & FMODE_READ) {
>  		struct seq_file *m = file->private_data;


Yeah, that avoids this need of creating a new flag.
Looks like a good solution.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ