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, 30 Nov 2009 11:43:21 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Veaceslav Falico <vfalico@...hat.com>,
	Paul Mackerras <paulus@...ba.org>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Christoph Hellwig <hch@...radead.org>,
	"Frank Ch. Eigler" <fche@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Roland McGrath <roland@...hat.com>,
	linux-kernel@...r.kernel.org, utrace-devel@...hat.com
Subject: Re: powerpc: syscall_dotrace() && retcode (Was: powerpc: fork &&
 stepping)

On Mon, 2009-11-30 at 10:15 +1100, Benjamin Herrenschmidt wrote:

> Yes, the asm should be changed. I suppose we could check if the result
> of do_syscall_trace_enter is negative, and if it is, branch to the exit
> path using r3 as the error code. Would that be ok ?
> 
> Something like this:

Note however that there's a trace exit too and that's normally the right
place to alter the result don't you think ?

Cheers,
Ben.

> diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
> index 1175a85..7a88c88 100644
> --- a/arch/powerpc/kernel/entry_32.S
> +++ b/arch/powerpc/kernel/entry_32.S
> @@ -419,6 +419,9 @@ syscall_dotrace:
>  	stw	r0,_TRAP(r1)
>  	addi	r3,r1,STACK_FRAME_OVERHEAD
>  	bl	do_syscall_trace_enter
> +	cmpwi	cr0,r3,0
> +	blt	ret_from_syscall
> +
>  	/*
>  	 * Restore argument registers possibly just changed.
>  	 * We use the return value of do_syscall_trace_enter
> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
> index 9763267..ec709a7 100644
> --- a/arch/powerpc/kernel/entry_64.S
> +++ b/arch/powerpc/kernel/entry_64.S
> @@ -240,6 +240,9 @@ syscall_dotrace:
>  	bl	.save_nvgprs
>  	addi	r3,r1,STACK_FRAME_OVERHEAD
>  	bl	.do_syscall_trace_enter
> +	cmpdi	cr0,r3,0
> +	blt	syscall_exit
> +
>  	/*
>  	 * Restore argument registers possibly just changed.
>  	 * We use the return value of do_syscall_trace_enter
> 
> 
> Cheers,
> Ben.


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