Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce5d1128 authored by Eric Paris's avatar Eric Paris
Browse files

ARCH: AUDIT: implement syscall_get_arch for all arches



For all arches which support audit implement syscall_get_arch()
They are all pretty easy and straight forward, stolen from how the call
to audit_syscall_entry() determines the arch.

Based-on-patch-by: default avatarRichard Briggs <rgb@redhat.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Cc: linux-ia64@vger.kernel.org
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: linux-mips@linux-mips.org
Cc: linux@lists.openrisc.net
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: sparclinux@vger.kernel.org
parent 0451623a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#ifndef _ASM_SYSCALL_H
#define _ASM_SYSCALL_H	1

#include <uapi/linux/audit.h>
#include <linux/sched.h>
#include <linux/err.h>

@@ -79,4 +80,9 @@ static inline void syscall_set_arguments(struct task_struct *task,

	ia64_syscall_get_set_arguments(task, regs, i, n, args, 1);
}

static inline int syscall_get_arch(void)
{
	return AUDIT_ARCH_IA64;
}
#endif	/* _ASM_SYSCALL_H */
+5 −0
Original line number Diff line number Diff line
#ifndef __ASM_MICROBLAZE_SYSCALL_H
#define __ASM_MICROBLAZE_SYSCALL_H

#include <uapi/linux/audit.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <asm/ptrace.h>
@@ -99,4 +100,8 @@ static inline void syscall_set_arguments(struct task_struct *task,
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);

static inline int syscall_get_arch(void)
{
	return AUDIT_ARCH_MICROBLAZE;
}
#endif /* __ASM_MICROBLAZE_SYSCALL_H */
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ extern const unsigned long sysn32_call_table[];

static inline int syscall_get_arch(void)
{
	int arch = EM_MIPS;
	int arch = AUDIT_ARCH_MIPS;
#ifdef CONFIG_64BIT
	if (!test_thread_flag(TIF_32BIT_REGS))
		arch |= __AUDIT_ARCH_64BIT;
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#ifndef __ASM_OPENRISC_SYSCALL_H__
#define __ASM_OPENRISC_SYSCALL_H__

#include <uapi/linux/audit.h>
#include <linux/err.h>
#include <linux/sched.h>

@@ -71,4 +72,8 @@ syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
	memcpy(&regs->gpr[3 + i], args, n * sizeof(args[0]));
}

static inline int syscall_get_arch(void)
{
	return AUDIT_ARCH_OPENRISC;
}
#endif
+11 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
#ifndef _ASM_PARISC_SYSCALL_H_
#define _ASM_PARISC_SYSCALL_H_

#include <uapi/linux/audit.h>
#include <linux/compat.h>
#include <linux/err.h>
#include <asm/ptrace.h>

@@ -37,4 +39,13 @@ static inline void syscall_get_arguments(struct task_struct *tsk,
	}
}

static inline int syscall_get_arch(void)
{
	int arch = AUDIT_ARCH_PARISC;
#ifdef CONFIG_64BIT
	if (!is_compat_task())
		arch = AUDIT_ARCH_PARISC64;
#endif
	return arch;
}
#endif /*_ASM_PARISC_SYSCALL_H_*/
Loading