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: <20190325143926.GA25867@guoren-Inspiron-7460>
Date:   Mon, 25 Mar 2019 22:39:26 +0800
From:   Guo Ren <guoren@...nel.org>
To:     arnd@...db.de, ldv@...linux.org
Cc:     linux-arch@...r.kernel.org, strace-devel@...ts.strace.io,
        linux-kernel@...r.kernel.org, ren_guo@...ky.com
Subject: Re: [PATCH] csky: Update syscall_trace_enter/exit implementation

On Mon, Mar 25, 2019 at 08:03:39PM +0800, guoren@...nel.org wrote:
> From: Guo Ren <ren_guo@...ky.com>
> 
> Previous syscall_trace implementation couldn't support AUDITSYSCALL and
> SYSCALL_TRACEPOINTS. Now we redesign it to support audit_syscall
> and syscall_tracepoints just like other archs'.
> 
> Signed-off-by: Guo Ren <ren_guo@...ky.com>
> Cc: Dmitry V. Levin <ldv@...linux.org>
> Cc: Arnd Bergmann <arnd@...db.de>
> ---
>  arch/csky/Kconfig                   |  2 ++
>  arch/csky/include/asm/syscall.h     |  2 ++
>  arch/csky/include/asm/thread_info.h | 25 ++++++++-----------
>  arch/csky/include/asm/unistd.h      |  2 ++
>  arch/csky/include/uapi/asm/ptrace.h |  5 ++++
>  arch/csky/kernel/entry.S            | 21 +++++++---------
...
> diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S
> index 5137ed9..ebd1957 100644
> --- a/arch/csky/kernel/entry.S
> +++ b/arch/csky/kernel/entry.S
> @@ -136,8 +136,8 @@ ENTRY(csky_systemcall)
>  	bmaski  r10, THREAD_SHIFT
>  	andn    r9, r10
>  	ldw     r8, (r9, TINFO_FLAGS)
> -	btsti   r8, TIF_SYSCALL_TRACE
> -	bt      1f
> +	andi	r8, (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
> +	bt      csky_syscall_trace
>  #if defined(__CSKYABIV2__)
>  	subi    sp, 8
>  	stw  	r5, (sp, 0x4)
> @@ -150,10 +150,9 @@ ENTRY(csky_systemcall)
>  	stw     a0, (sp, LSAVE_A0)      /* Save return value */
>  	jmpi    ret_from_exception
>  
> -1:
> -	movi	a0, 0                   /* enter system call */
> -	mov	a1, sp                  /* sp = pt_regs pointer */
> -	jbsr	syscall_trace
> +csky_syscall_trace:
> +	mov	a0, sp                  /* sp = pt_regs pointer */
> +	jbsr	syscall_trace_enter
>  	/* Prepare args before do system call */
>  	ldw	a0, (sp, LSAVE_A0)
>  	ldw	a1, (sp, LSAVE_A1)
> @@ -173,9 +172,8 @@ ENTRY(csky_systemcall)
>  #endif
>  	stw	a0, (sp, LSAVE_A0)	/* Save return value */
>  
> -	movi    a0, 1                   /* leave system call */
> -	mov     a1, sp                  /* right now, sp --> pt_regs */
> -	jbsr    syscall_trace
> +	mov     a0, sp                  /* right now, sp --> pt_regs */
> +	jbsr    syscall_trace_exit
>  	br	ret_from_exception
>  
>  ENTRY(ret_from_kernel_thread)
> @@ -193,9 +191,8 @@ ENTRY(ret_from_fork)
>  	movi	r11_sig, 1
>  	btsti	r8, TIF_SYSCALL_TRACE
It's wrong, I should use: 
+	andi	r8, (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)

Best Regards
 Guo Ren

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ