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: <26d4d13f-d678-be54-6b40-b87c71856eff@loongson.cn>
Date:   Mon, 17 Apr 2023 10:04:02 +0800
From:   Youling Tang <tangyouling@...ngson.cn>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>, loongarch@...ts.linux.dev,
        linux-kernel@...r.kernel.org, loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v2 4/4] LoongArch: Add uprobes support

Hi, Tiezhu

On 04/14/2023 05:33 PM, Tiezhu Yang wrote:

/* snip */

> diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c
> index de8ebe2..cfc2e0c 100644
> --- a/arch/loongarch/kernel/traps.c
> +++ b/arch/loongarch/kernel/traps.c
> @@ -45,6 +45,7 @@
>  #include <asm/tlb.h>
>  #include <asm/types.h>
>  #include <asm/unwind.h>
> +#include <asm/uprobes.h>
>
>  #include "access-helper.h"
>
> @@ -440,7 +441,6 @@ asmlinkage void noinstr do_bp(struct pt_regs *regs)
>  	if (regs->csr_prmd & CSR_PRMD_PIE)
>  		local_irq_enable();
>
> -	current->thread.trap_nr = read_csr_excode();
>  	if (__get_inst(&opcode, (u32 *)era, user))
>  		goto out_sigsegv;
>
> @@ -462,18 +462,17 @@ asmlinkage void noinstr do_bp(struct pt_regs *regs)
>  		else
>  			break;
>  	case BRK_UPROBE_BP:
> -		if (notify_die(DIE_UPROBE, "Uprobe", regs, bcode,
> -			       current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
> +		if (uprobe_breakpoint_handler(regs))
>  			goto out;
>  		else
>  			break;
>  	case BRK_UPROBE_XOLBP:
> -		if (notify_die(DIE_UPROBE_XOL, "Uprobe_XOL", regs, bcode,
> -			       current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
> +		if (uprobe_singlestep_handler(regs))

After the above modification, we should remove the DIE_UPROBE and
DIE_UPROBE_XOL definitions in arch/loongarch/include/asm/kdebug.h.

At the same time DIE_BREAK, DIE_SSTEPBP and DIE_PAGE_FAULT also need to
be removed after 6d4cc40fb5f581 ("LoongArch: Add kprobes support").

Thanks,
Youling
>  			goto out;
>  		else
>  			break;
>  	default:
> +		current->thread.trap_nr = read_csr_excode();
>  		if (notify_die(DIE_TRAP, "Break", regs, bcode,
>  			       current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
>  			goto out;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ