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]
Message-ID: <alpine.LNX.2.00.1501140930260.4162@pobox.suse.cz>
Date:	Wed, 14 Jan 2015 09:34:30 +0100 (CET)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Josh Poimboeuf <jpoimboe@...hat.com>,
	Christoph Hellwig <hch@...radead.org>,
	linux-kernel@...r.kernel.org, live-patching@...r.kernel.org,
	linux-next@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] ftrace: don't allow IPMODIFY without proper compiler
 support (was Re: Re: livepatching tree for linux-next)

On Wed, 14 Jan 2015, Masami Hiramatsu wrote:

> > diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> > index f45acad..29fa417 100644
> > --- a/arch/x86/include/asm/ftrace.h
> > +++ b/arch/x86/include/asm/ftrace.h
> > @@ -4,8 +4,10 @@
> >  #ifdef CONFIG_FUNCTION_TRACER
> >  #ifdef CC_USING_FENTRY
> >  # define MCOUNT_ADDR		((long)(__fentry__))
> > +# define arch_ftrace_ipmodify_compiler_support(void) ({ 1; })
> >  #else
> >  # define MCOUNT_ADDR		((long)(mcount))
> > +#define arch_ftrace_ipmodify_compiler_support(void) ({ 0; })
> 
> Hmm, can we just define ARCH_FTRACE_SUPPORT_IPMODIFY here?

Yup, that's more or less what Steven suggested as well. I'll send v2.

> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index 929a733..11370fd 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -1809,6 +1809,11 @@ static int __ftrace_hash_update_ipmodify(struct ftrace_ops *ops,
> >  	if (!(ops->flags & FTRACE_OPS_FL_IPMODIFY))
> >  		return 0;
> >  
> > +	if (!arch_ftrace_ipmodify_compiler_support()) {
> > +		WARN(1, "Your compiler doesn't support features necessary for IPMODIFY");
> > +		return 0;
> > +	}
> 
> Actually, if ftrace doesn't support IPMODIFY, I would like to just drop
> the entire code for CONFIG_KPROBES_ON_FTRACE(this is a hidden config),
> instead of checking at runtime.
> 
> So, there are 2 ifdefs of code in kernel/kprobes.c for 
> CONFIG_KPROBES_ON_FTRACE, those should also check 
> ARCH_FTRACE_SUPPORT_IPMODIFY too.

Makes sense. Will send that as a followup patch once the way how to do 
this in ftrace is settled.

Thanks,

-- 
Jiri Kosina
SUSE Labs
--
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