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:   Fri, 24 Jul 2020 13:11:03 +0530
From:   Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Aaron Merey <amerey@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] uprobes: change handle_swbp() to send SIGTRAP with
 si_code=SI_KERNEL

* Oleg Nesterov <oleg@...hat.com> [2020-07-23 17:44:20]:

> If a tracee is uprobed and it hits int3 inserted by debugger, handle_swbp()
> does send_sig(SIGTRAP, current, 0) which means si_code == SI_USER. This used
> to work when this code was written, but then GDB started to validate si_code
> and now it simply can't use breakpoints if the tracee has an active uprobe:
> 
> 
> The tracee hits the internal breakpoint inserted by GDB to monitor shared
> library events but GDB misinterprets this SIGTRAP and reports a signal.
> 
> Change handle_swbp() to use force_sig(SIGTRAP), this matches do_int3_user()
> and fixes the problem.
> 
> This is the minimal fix for -stable, arch/x86/kernel/uprobes.c is equally
> wrong; it should use send_sigtrap(TRAP_TRACE) instead of send_sig(SIGTRAP),
> but this doesn't confuse GDB and needs another x86-specific patch.
> 
> Reported-by: Aaron Merey <amerey@...hat.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
> ---
>  kernel/events/uprobes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index bb0862873dba..5f8b0c52fd2e 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -2199,7 +2199,7 @@ static void handle_swbp(struct pt_regs *regs)
>  	if (!uprobe) {
>  		if (is_swbp > 0) {
>  			/* No matching uprobe; signal SIGTRAP. */
> -			send_sig(SIGTRAP, current, 0);
> +			force_sig(SIGTRAP);
>  		} else {
>  			/*
>  			 * Either we raced with uprobe_unregister() or we can't
> -- 
> 2.25.1.362.g51ebf55
> 
> 

-- 
Thanks and Regards
Srikar Dronamraju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ