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

Commit cfcd1705 authored by David Woodhouse's avatar David Woodhouse Committed by Paul Mackerras
Browse files

[POWERPC] Mask 32-bit system call arguments to 32 bits on PPC64 in audit code



The system call entry code will clear the high bits of argument
registers before invoking the system call; don't report whatever noise
happens to be in the high bits of the register before that happens.

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 0e47e3cc
Loading
Loading
Loading
Loading
+15 −9
Original line number Original line Diff line number Diff line
@@ -532,16 +532,22 @@ void do_syscall_trace_enter(struct pt_regs *regs)
	    && (current->ptrace & PT_PTRACED))
	    && (current->ptrace & PT_PTRACED))
		do_syscall_trace();
		do_syscall_trace();


	if (unlikely(current->audit_context))
	if (unlikely(current->audit_context)) {
		audit_syscall_entry(
#ifdef CONFIG_PPC64
#ifdef CONFIG_PPC32
		if (!test_thread_flag(TIF_32BIT))
				    AUDIT_ARCH_PPC,
			audit_syscall_entry(AUDIT_ARCH_PPC64,
#else
				    test_thread_flag(TIF_32BIT)?AUDIT_ARCH_PPC:AUDIT_ARCH_PPC64,
#endif
					    regs->gpr[0],
					    regs->gpr[0],
					    regs->gpr[3], regs->gpr[4],
					    regs->gpr[3], regs->gpr[4],
					    regs->gpr[5], regs->gpr[6]);
					    regs->gpr[5], regs->gpr[6]);
		else
#endif
			audit_syscall_entry(AUDIT_ARCH_PPC,
					    regs->gpr[0],
					    regs->gpr[3] & 0xffffffff,
					    regs->gpr[4] & 0xffffffff,
					    regs->gpr[5] & 0xffffffff,
					    regs->gpr[6] & 0xffffffff);
	}
}
}


void do_syscall_trace_leave(struct pt_regs *regs)
void do_syscall_trace_leave(struct pt_regs *regs)