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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 04 Jun 2012 22:58:01 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	"Frank Ch. Eigler" <fche@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	yrl.pp-manager.tt@...achi.com
Subject: Re: Re: [RFC PATCH -tip  1/9] ftrace: Add pt_regs acceptable trace
 callback

(2012/06/02 11:07), Steven Rostedt wrote:
> On Tue, 2012-05-29 at 21:48 +0900, Masami Hiramatsu wrote:
> 
>>  struct ftrace_ops {
>> -	ftrace_func_t			func;
>> +	union {
>> +		ftrace_func_t			func;
>> +		ftrace_regs_func_t		regs_func;
>> +	};
>>  	struct ftrace_ops		*next;
>>  	unsigned long			flags;
>>  	int __percpu			*disabled;
>> @@ -164,6 +182,7 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops)
>>  }
> 
> [..]
> 
>>  
>>  static struct ftrace_ops global_ops = {
>> -	.func			= ftrace_stub,
>> +	.regs_func		= ftrace_regs_stub,
>>  	.notrace_hash		= EMPTY_HASH,
>>  	.filter_hash		= EMPTY_HASH,
>> +	.flags			= FTRACE_OPS_FL_SAVE_REGS,
>>  };
>>  
>>  static DEFINE_MUTEX(ftrace_regex_lock);
>> @@ -3911,7 +3924,8 @@ void __init ftrace_init(void)
>>  #else
>>  
>>  static struct ftrace_ops global_ops = {
>> -	.func			= ftrace_stub,
>> +	.regs_func		= ftrace_regs_stub,
>> +	.flags			= FTRACE_OPS_FL_SAVE_REGS,
>>  };
>>  
> 
> Ug, this wont compile with some versions of gcc :-(
> 
> The one I stumbled on is gcc 4.5.1 (which I test builds against 4.5.1
> and 4.6.0). Then I saw this BZ:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
> 
> This can't be a union :-(  Then we can not initialize it.

Hmm, how about initializing in __init function ?
Or we can make func and regs_func in different members,
instead of using a union. (in that case, we can remove
FTRACE_OPS_FL_SAVE_REGS.)
I just consider passing uninitialized argument to user
function can cause unexpected behavior...

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
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