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: <593967C0.4030904@arm.com>
Date:   Thu, 08 Jun 2017 16:05:36 +0100
From:   James Morse <james.morse@....com>
To:     Yury Norov <ynorov@...iumnetworks.com>
CC:     Catalin Marinas <catalin.marinas@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-doc@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
        Andrew Pinski <pinskia@...il.com>,
        Andrew Pinski <Andrew.Pinski@...iumnetworks.com>,
        Adam Borowski <kilobyte@...band.pl>,
        Chris Metcalf <cmetcalf@...hip.com>,
        Steve Ellcey <sellcey@...iumnetworks.com>,
        Maxim Kuvyrkov <maxim.kuvyrkov@...aro.org>,
        Ramana Radhakrishnan <ramana.gcc@...glemail.com>,
        Florian Weimer <fweimer@...hat.com>,
        Bamvor Zhangjian <bamvor.zhangjian@...wei.com>,
        Andreas Schwab <schwab@...e.de>,
        Chris Metcalf <cmetcalf@...lanox.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        schwidefsky@...ibm.com, broonie@...nel.org,
        Joseph Myers <joseph@...esourcery.com>,
        christoph.muellner@...obroma-systems.com, szabolcs.nagy@....com,
        klimov.linux@...il.com, Nathan_Lynch@...tor.com, agraf@...e.de,
        Prasun.Kapoor@...iumnetworks.com, geert@...ux-m68k.org,
        philipp.tomsich@...obroma-systems.com, manuel.montezelo@...il.com,
        linyongting@...wei.com, davem@...emloft.net,
        zhouchengming1@...wei.com, Andrew Pinski <apinski@...ium.com>,
        Bamvor Jian Zhang <bamvor.zhangjian@...aro.org>
Subject: Re: [PATCH 14/20] arm64: ilp32: add sys_ilp32.c and a separate table
 (in entry.S) to use it

Hi Yury,

On 04/06/17 13:00, Yury Norov wrote:
> From: Andrew Pinski <apinski@...ium.com>
> 
> Add a separate syscall-table for ILP32, which dispatches either to native
> LP64 system call implementation or to compat-syscalls, as appropriate.

(I'm still reading through this series trying to understand it, but spotted this: )

> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 279bc2ab10c3..7d52fe1ec6bd 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -577,6 +594,7 @@ el0_svc_compat:
>  	 * AArch32 syscall handling
>  	 */
>  	adrp	stbl, compat_sys_call_table	// load compat syscall table pointer
> +	ldr     x16, [tsk, #TSK_TI_FLAGS]
>  	uxtw	scno, w7			// syscall number in w7 (r7)
>  	mov     sc_nr, #__NR_compat_syscalls
>  	b	el0_svc_naked
> @@ -798,15 +816,21 @@ ENDPROC(ret_from_fork)
>  	.align	6
>  el0_svc:
>  	adrp	stbl, sys_call_table		// load syscall table pointer
> +	ldr	x16, [tsk, #TSK_TI_FLAGS]
>  	uxtw	scno, w8			// syscall number in w8
>  	mov	sc_nr, #__NR_syscalls
> +#ifdef CONFIG_ARM64_ILP32
> +	tst	x16, #_TIF_32BIT_AARCH64
> +	b.eq	el0_svc_naked			// We are using LP64  syscall table
> +	adrp	stbl, sys_call_ilp32_table	// load ilp32 syscall table pointer
> +	delouse_input_regs
> +#endif
>  el0_svc_naked:					// compat entry point
>  	stp	x0, scno, [sp, #S_ORIG_X0]	// save the original x0 and syscall number
>  	enable_dbg_and_irq
>  	ct_user_exit 1
>  

> -	ldr	x16, [tsk, #TSK_TI_FLAGS]	// check for syscall hooks

If built with CONFIG_CONTEXT_TRACKING, ct_user_exit will call
context_tracking_user_exit(), this will clobber x16 which you depend on not
changing below:


> -	tst	x16, #_TIF_SYSCALL_WORK
> +	tst	x16, #_TIF_SYSCALL_WORK		// check for syscall hooks

>  	b.ne	__sys_trace
>  	cmp     scno, sc_nr                     // check upper syscall limit
>  	b.hs	ni_sys


Thanks,

James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ