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] [day] [month] [year] [list]
Message-ID: <20140424084947.38ecc6f9@gandalf.local.home>
Date:	Thu, 24 Apr 2014 08:49:47 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Takao Indoh <indou.takao@...fujitsu.com>
Cc:	masami.hiramatsu.pt@...achi.com, rusty@...tcorp.com.au,
	fweisbec@...il.com, mingo@...hat.com, ananth@...ibm.com,
	anil.s.keshavamurthy@...el.com, davem@...emloft.net,
	linux-kernel@...r.kernel.org
Subject: Re: ftrace/kprobes: Warning when insmod two modules

On Thu, 24 Apr 2014 15:58:53 +0900
Takao Indoh <indou.takao@...fujitsu.com> wrote:

> Ok, I'll do this. Something like this, right?
> 
> static void ftrace_init_module(struct module *mod,
>                                unsigned long *start, unsigned long *end)
> {
> 	if (ftrace_disabled || start == end)
> 		return;
> 
> 	/*
> 	 * Need ftrace_lock here to prevent someone from changing the module
> 	 * text to RO by set_all_modules_text_ro(). Currently ftrace is the
> 	 * only user of set_all_modules_text_ro(), so until another user
> 	 * appears, ftrace_lock mutex can work.
> 	 */
> 	mutex_lock(&ftrace_lock);
> 
> 	set_one_module_text_rw(mod);
> 	ftrace_process_locs(mod, start, end);
> 	set_one_module_text_ro(mod);
> 
> 	mutex_unlock(&ftrace_lock);
> }
> 

I like Rusty's solution the best. Just hard code the call to ftrace's
module init code where it is still safe to do so
(MODULE_STATE_UNFORMED). This seems to be an ftrace only issue.

Thanks,

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