[PATCH 3/4] ARCH: AUDIT: implement syscall_get_arch for all arches
Stephen Rothwell
sfr at canb.auug.org.au
Tue Apr 22 13:09:31 EST 2014
Hi Eric,
[I just noticed that this turned up in linux-next ...]
On Wed, 19 Mar 2014 18:04:02 -0400 Eric Paris <eparis at redhat.com> wrote:
>
> diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
> index b54b2ad..4271544 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -13,6 +13,8 @@
> #ifndef _ASM_SYSCALL_H
> #define _ASM_SYSCALL_H 1
>
> +#include <uapi/linux/audit.h>
> +#include <linux/compat.h>
You don't need linux/compat.h, I think, but you do need to include
linux/thread_info.h for is_32bit_task() below.
> #include <linux/sched.h>
>
> /* ftrace syscalls requires exporting the sys_call_table */
> @@ -86,4 +88,14 @@ static inline void syscall_set_arguments(struct task_struct *task,
> memcpy(®s->gpr[3 + i], args, n * sizeof(args[0]));
> }
>
> +static inline int syscall_get_arch(void)
> +{
> + int arch = AUDIT_ARCH_PPC;
> +
> +#ifdef CONFIG_PPC64
> + if (!is_32bit_task())
> + arch = AUDIT_ARCH_PPC64;
> +#endif
> + return arch;
This could just be
return is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
as is_32bit_task() is always defined (and is (1) for !CONFIG_PPC64).
--
Cheers,
Stephen Rothwell sfr at canb.auug.org.au
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20140422/3ea1c377/attachment.sig>
More information about the Linuxppc-dev
mailing list