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: <20171020063812.ca0b931fb88df393772acbba@kernel.org>
Date:   Fri, 20 Oct 2017 06:38:12 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Revert
 "kprobes: Warn if optprobe handler tries to change execution path"

On Tue, 17 Oct 2017 13:48:34 +0530
"Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com> wrote:

> This reverts commit e863d539614641 ("kprobes: Warn if optprobe handler
> tries to change execution path").
> 
> On powerpc, we place a probe at kretprobe_trampoline to catch function
> returns and with CONFIG_OPTPROBES, this probe gets optimized. This
> works for us due to the way we handle the optprobe as described in
> commit 762df10bad6954 ("powerpc/kprobes: Optimize kprobe
> in kretprobe_trampoline()"). With the above commit, we end up with a
> warning. As such, revert this change.

OK, so for ppc, optprobe can handle nip change.

Acked-by: Masami Hiramatsu <mhiramat@...nel.org>

I'll update the document too.

Thanks,

> 
> Reported-by: Michael Ellerman <mpe@...erman.id.au>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
> ---
> Discussion here:
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1510995.html
> 
>  kernel/kprobes.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 2d28377a0e32..15fba7fe57c8 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -387,10 +387,7 @@ void opt_pre_handler(struct kprobe *p, struct pt_regs *regs)
>  	list_for_each_entry_rcu(kp, &p->list, list) {
>  		if (kp->pre_handler && likely(!kprobe_disabled(kp))) {
>  			set_kprobe_instance(kp);
> -			if (kp->pre_handler(kp, regs)) {
> -				if (WARN_ON_ONCE(1))
> -					pr_err("Optprobe ignores instruction pointer changing.(%pF)\n", p->addr);
> -			}
> +			kp->pre_handler(kp, regs);
>  		}
>  		reset_kprobe_instance();
>  	}
> -- 
> 2.14.2
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ