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]
Message-ID: <1310511415.3931.11.camel@gandalf.stny.rr.com>
Date:	Tue, 12 Jul 2011 18:56:55 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Sonny Rao <sonnyrao@...omium.org>
Cc:	acme@...hat.com, anton@...ba.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [RFC] perf: robustify proc and debugfs file recording

On Tue, 2011-07-12 at 14:15 -0700, Sonny Rao wrote:
> While attempting to create a timechart of boot up I found
> perf didn't tolerate modules being loaded/unloaded.  This patch
> fixes this by reading the file once and then writing the size
> read at the correct point in the file.  It also simplifies the
> code somewhat.
> 
> Signed-off-by: Sonny Rao <sonnyrao@...omium.org>

>  static bool name_in_tp_list(char *sys, struct tracepoint_path *tps)
> @@ -338,14 +292,8 @@ static void copy_event_system(const char *sys, struct tracepoint_path *tps)
>  		sprintf(format, "%s/%s/format", sys, dent->d_name);
>  		ret = stat(format, &st);
>  
> -		if (ret >= 0) {
> -			/* unfortunately, you can not stat debugfs files for size */
> -			size = get_size(format);
> -			write_or_die(&size, 8);
> -			check_size = copy_file(format);
> -			if (size != check_size)
> -				die("error in size of file '%s'", format);

You mean to tell me that you are hitting a race between the get_size()
and check_size()?  This is a very quick action, and this only happens at
start up. Are you starting up perf and loading modules at the same time?

-- Steve

> -		}
> +		if (ret >= 0)
> +			record_file(format, 8);
>  
>  		free(format);


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