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: <20090217190253.GA10322@flint.arm.linux.org.uk>
Date:	Tue, 17 Feb 2009 19:02:53 +0000
From:	Russell King <rmk+lkml@....linux.org.uk>
To:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Cc:	"Rosendahl Viktor (Nokia-D/Helsinki)" <Viktor.Rosendahl@...ia.com>,
	ext Tony Lindgren <tony@...mide.com>,
	"Moiseichuk Leonid (Nokia-D/Helsinki)" <leonid.moiseichuk@...ia.com>,
	"Kallioinen Juha (Nokia-D/Helsinki)" <juha.kallioinen@...ia.com>,
	Siarhei Siamashka <siarhei.siamashka@...ia.com>,
	Eero Tamminen <eero.tamminen@...ia.com>,
	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.arm.linux.org.uk
Subject: Re: [PATCH] ARM fix syscall trace return value

On Tue, Feb 17, 2009 at 01:18:05PM -0500, Mathieu Desnoyers wrote:
> I am currently finding core bugs in the Linux kernel implementation of
> the ARM architecture. :-( e.g. return value not being sent to the
> syscall_trace function upon exit (upon which LTTng depends). (patch
> below)

Well then how can strace work?  The fact of the matter is that strace
can and does work, and so I suspect that the problem is not in the
kernel but whatever "LTTng" is trying to do.

> BTW, the patch below applies to 2.6.29-rc4.

And is wrong.

> Index: linux-omap-2.6/arch/arm/kernel/entry-common.S
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/kernel/entry-common.S	2009-02-17 16:58:14.000000000 +0000
> +++ linux-omap-2.6/arch/arm/kernel/entry-common.S	2009-02-17 17:24:33.000000000 +0000
> @@ -89,6 +89,7 @@
>  	mov	why, #1
>  	tst	r1, #_TIF_SYSCALL_TRACE		@ are we tracing syscalls?
>  	beq	ret_slow_syscall
> +	mov	r2, #0				@ fork returns 0 to the child

This may be incorrect.

>  	mov	r1, sp
>  	mov	r0, #1				@ trace exit [IP = 1]
>  	bl	syscall_trace
> @@ -292,7 +293,7 @@
>  
>  __sys_trace_return:
>  	str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0
> -	mov	r2, scno
> +	mov	r2, r0

This part is wrong.  'r2' *is* the syscall number.

The place to get the return value is by reading the registers, r0 to be
exact.  No other method is supported.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
--
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