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, 24 Mar 2014 15:45:18 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Andi Kleen <ak@...ux.intel.com>,
	Andi Kleen <andi@...stfloor.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Sandeepa Prabhu <sandeepa.prabhu@...aro.org>,
	Frederic Weisbecker <fweisbec@...il.com>, x86@...nel.org,
	Oleg Nesterov <oleg@...hat.com>, fche@...hat.com,
	mingo@...hat.com,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Seiji Aguchi <seiji.aguchi@....com>, systemtap@...rceware.org,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>
Subject: Re: [PATCH -tip v8 14/26] x86: Use NOKPROBE_SYMBOL() instead of
 __kprobes annotation

On Wed, 05 Mar 2014 21:00:21 +0900
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com> wrote:
  
>  /*
>   * This is gone through when something in the kernel has done something bad
> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> index ae5aafb..d00103a 100644
> --- a/arch/x86/kernel/kprobes/core.c
> +++ b/arch/x86/kernel/kprobes/core.c
> @@ -112,7 +112,8 @@ struct kretprobe_blackpoint kretprobe_blacklist[] = {
>  
>  const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist);
>  
> -static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op)
> +static nokprobe_inline
> +void __synthesize_relative_insn(void *from, void *to, u8 op)

I believe the proper way to break this up is:

static nokprobe_inline void
__synthesize_relative_insn(...)


  
> -static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
> +static nokprobe_inline
> +void save_previous_kprobe(struct kprobe_ctlblk *kcb)

Here too.

>  {
>  	kcb->prev_kprobe.kp = kprobe_running();
>  	kcb->prev_kprobe.status = kcb->kprobe_status;
> @@ -433,7 +438,8 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
>  	kcb->prev_kprobe.saved_flags = kcb->kprobe_saved_flags;
>  }
>  
> -static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
> +static nokprobe_inline
> +void restore_previous_kprobe(struct kprobe_ctlblk *kcb)

and again.

>  {
>  	__this_cpu_write(current_kprobe, kcb->prev_kprobe.kp);
>  	kcb->kprobe_status = kcb->prev_kprobe.status;
> @@ -441,8 +447,9 @@ static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
>  	kcb->kprobe_saved_flags = kcb->prev_kprobe.saved_flags;
>  }
>  
> -static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
> -				struct kprobe_ctlblk *kcb)
> +static nokprobe_inline
> +void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,

and again.

> +			struct kprobe_ctlblk *kcb)
>  {
>  	__this_cpu_write(current_kprobe, p);
>  	kcb->kprobe_saved_flags = kcb->kprobe_old_flags
> @@ -451,7 +458,7 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
>  		kcb->kprobe_saved_flags &= ~X86_EFLAGS_IF;
>  }



> diff --git a/arch/x86/kernel/kprobes/ftrace.c b/arch/x86/kernel/kprobes/ftrace.c
> index dcaa131..717b02a 100644
> --- a/arch/x86/kernel/kprobes/ftrace.c
> +++ b/arch/x86/kernel/kprobes/ftrace.c
> @@ -25,8 +25,9 @@
>  
>  #include "common.h"
>  
> -static int __skip_singlestep(struct kprobe *p, struct pt_regs *regs,
> -			     struct kprobe_ctlblk *kcb)
> +static nokprobe_inline
> +int __skip_singlestep(struct kprobe *p, struct pt_regs *regs,

Here too.

> +		      struct kprobe_ctlblk *kcb)
>  {
>  	/*
>  	 * Emulate singlestep (and also recover regs->ip)
> @@ -41,18 +42,19 @@ static int __skip_singlestep(struct kprobe *p, struct pt_regs *regs,
>  	return 1;
>  }
>  



> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index ba9abe9..3c8ae7d 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -106,7 +106,7 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
>  	preempt_count_dec();
>  }
>  
> -static int __kprobes
> +static nokprobe_inline int
>  do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,

Here you do it correctly :-)

>  		  struct pt_regs *regs,	long error_code)
>  {
> @@ -136,7 +136,7 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
>  	return -1;
>  }
>  


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