Re: [PATCH 2/2] x86-64: seccomp: fix 32/64 syscall hole

From: Linus Torvalds
Date: Fri Feb 27 2009 - 22:37:38 EST




On Fri, 27 Feb 2009, Roland McGrath wrote:
> --- a/arch/x86/include/asm/seccomp_64.h
> +++ b/arch/x86/include/asm/seccomp_64.h
> +/*
> + * This indicates we are inside a 32-bit system call (only testable
> + * synchronously by current), whereas TIF_IA32 indicates we are a 32-bit
> + * task. A 32-bit task can make a 64-bit syscall by ljmp into 64-bit
> + * USER_CS, and a 64-bit task can make a 32-bit syscall by int $0x80.
> + */
> +#define IS_COMPAT_TASK is_compat_task()
> +
> --- a/kernel/seccomp.c
> +++ b/kernel/seccomp.c
> +#if defined TIF_32BIT && !defined IS_COMPAT_TASK
> +# define IS_COMPAT_TASK test_thread_flag(TIF_32BIT)
> +#endif
> +
> +#ifdef IS_COMPAT_TASK

Ok, please explain this madness.

The whole crazy IS_COMPAT_TASK dance seems to be too messy for words. Why?
What's going on?

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/