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

Commit b05d8447 authored by Eric Paris's avatar Eric Paris Committed by Al Viro
Browse files

audit: inline audit_syscall_entry to reduce burden on archs



Every arch calls:

if (unlikely(current->audit_context))
	audit_syscall_entry()

which requires knowledge about audit (the existance of audit_context) in
the arch code.  Just do it all in static inline in audit.h so that arch's
can remain blissfully ignorant.

Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent f031cd25
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -1246,15 +1246,8 @@ syscall_trace_enter (long arg0, long arg1, long arg2, long arg3,
	if (test_thread_flag(TIF_RESTORE_RSE))
		ia64_sync_krbs();

	if (unlikely(current->audit_context)) {
		long syscall;
		int arch;

		syscall = regs.r15;
		arch = AUDIT_ARCH_IA64;

		audit_syscall_entry(arch, syscall, arg0, arg1, arg2, arg3);
	}
	audit_syscall_entry(AUDIT_ARCH_IA64, regs.r15, arg0, arg1, arg2, arg3);

	return 0;
}
+2 −4
Original line number Diff line number Diff line
@@ -147,9 +147,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
		 */
		ret = -1L;

	if (unlikely(current->audit_context))
		audit_syscall_entry(EM_MICROBLAZE, regs->r12,
				    regs->r5, regs->r6,
	audit_syscall_entry(EM_MICROBLAZE, regs->r12, regs->r5, regs->r6,
			    regs->r7, regs->r8);

	return ret ?: regs->r12;
+3 −4
Original line number Diff line number Diff line
@@ -560,7 +560,6 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
	}

out:
	if (unlikely(current->audit_context))
	audit_syscall_entry(audit_arch(), regs->regs[2],
			    regs->regs[4], regs->regs[5],
			    regs->regs[6], regs->regs[7]);
+12 −14
Original line number Diff line number Diff line
@@ -1724,7 +1724,6 @@ long do_syscall_trace_enter(struct pt_regs *regs)
	if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
		trace_sys_enter(regs, regs->gpr[0]);

	if (unlikely(current->audit_context)) {
#ifdef CONFIG_PPC64
	if (!is_32bit_task())
		audit_syscall_entry(AUDIT_ARCH_PPC64,
@@ -1739,7 +1738,6 @@ long do_syscall_trace_enter(struct pt_regs *regs)
				    regs->gpr[4] & 0xffffffff,
				    regs->gpr[5] & 0xffffffff,
				    regs->gpr[6] & 0xffffffff);
	}

	return ret ?: regs->gpr[0];
}
+5 −6
Original line number Diff line number Diff line
@@ -740,7 +740,6 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
	if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
		trace_sys_enter(regs, regs->gprs[2]);

	if (unlikely(current->audit_context))
	audit_syscall_entry(is_compat_task() ?
				AUDIT_ARCH_S390 : AUDIT_ARCH_S390X,
			    regs->gprs[2], regs->orig_gpr2,
Loading