Re: [PATCH 2/4] UM: implement syscall_get_arch()

Richard Guy Briggs
2014-03-21T19:08:03Z

On 14/03/19, Eric Paris wrote:
> SH: define syscall_get_arch() for superh
>
> This patch defines syscall_get_arch() for the um platform. It adds a
> new syscall.h header file to define this. It copies the HOST_AUDIT_ARCH
> definition from ptrace.h. (that definition will be removed when we
> switch audit to use this new syscall_get_arch() function)

Why not just use:

diff --git a/arch/um/include/asm/syscall.h
b/arch/um/include/asm/syscall.h
new file mode 100644
index 0000000..fbcb2e4
--- /dev/null
+++ b/arch/um/include/asm/syscall.h
@@ -0,0 +1,9 @@
+#ifndef __ASM_UM_SYSCALL_H
+#define __ASM_UM_SYSCALL_H
+
+static inline int syscall_get_arch(void)
+{
+ return HOST_AUDIT_ARCH;
+}
+
+#endif /* __ASM_SH_SYSCALL_H */

> Signed-off-by: Eric Paris <eparis@redhat.com>
> Cc: user-mode-linux-devel@lists.sourceforge.net
> ---
> arch/x86/um/asm/syscall.h | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
> create mode 100644 arch/x86/um/asm/syscall.h
>
> diff --git a/arch/x86/um/asm/syscall.h b/arch/x86/um/asm/syscall.h
> new file mode 100644
> index 0000000..9fe77b7
> --- /dev/null
> +++ b/arch/x86/um/asm/syscall.h
> @@ -0,0 +1,15 @@
> +#ifndef __UM_ASM_SYSCALL_H
> +#define __UM_ASM_SYSCALL_H
> +
> +#include <uapi/linux/audit.h>
> +
> +static inline int syscall_get_arch(void)
> +{
> +#ifdef CONFIG_X86_32
> + return AUDIT_ARCH_I386;
> +#else
> + return AUDIT_ARCH_X86_64;
> +#endif
> +}
> +
> +#endif /* __UM_ASM_SYSCALL_H */
> --
> 1.8.5.3
>
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545