Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 25 Mar 2012 12:34:58 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Will Drewry <wad@...omium.org>
CC: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
        linux-doc@...r.kernel.org, kernel-hardening@...ts.openwall.com,
        netdev@...r.kernel.org, x86@...nel.org, arnd@...db.de,
        davem@...emloft.net, mingo@...hat.com, oleg@...hat.com,
        peterz@...radead.org, rdunlap@...otime.net, mcgrathr@...omium.org,
        tglx@...utronix.de, luto@....edu, eparis@...hat.com,
        serge.hallyn@...onical.com, djm@...drot.org, scarybeasts@...il.com,
        indan@....nu, pmoore@...hat.com, akpm@...ux-foundation.org,
        corbet@....net, eric.dumazet@...il.com, markus@...omium.org,
        coreyb@...ux.vnet.ibm.com, keescook@...omium.org
Subject: Re: [PATCH v15 04/13] arch/x86: add syscall_get_arch to syscall.h

On 03/14/2012 08:11 PM, Will Drewry wrote:
>  
> +static inline int syscall_get_arch(struct task_struct *task,
> +				   struct pt_regs *regs)
> +{
> +#ifdef CONFIG_IA32_EMULATION
> +	/*
> +	 * TS_COMPAT is set for 32-bit syscall entries and then
> +	 * remains set until we return to user mode.
> +	 *
> +	 * TIF_IA32 tasks should always have TS_COMPAT set at
> +	 * system call time.
> +	 */
> +	if (task_thread_info(task)->status & TS_COMPAT)
> +		return AUDIT_ARCH_I386;
> +#endif
> +	return AUDIT_ARCH_X86_64;
> +}
>  #endif	/* CONFIG_X86_32 */
>  
>  #endif	/* _ASM_X86_SYSCALL_H */

Just one FYI on this: after the x32 changes are upstream this can be
implemented in terms of is_ia32_task().

	-hpa

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.