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

Commit ee436dc4 authored by David Woodhouse's avatar David Woodhouse Committed by Al Viro
Browse files

[PATCH] Fix IA64 success/failure indication in syscall auditing.



Original 2.6.9 patch and explanation from somewhere within HP via
bugzilla...

ia64 stores a success/failure code in r10, and the return value (normal
return, or *positive* errno) in r8. The patch also sets the exit code to
negative errno if it's a failure result for consistency with other
architectures.

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 7306a0b9
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -1656,8 +1656,14 @@ syscall_trace_leave (long arg0, long arg1, long arg2, long arg3,
		     long arg4, long arg5, long arg6, long arg7,
		     long arg4, long arg5, long arg6, long arg7,
		     struct pt_regs regs)
		     struct pt_regs regs)
{
{
	if (unlikely(current->audit_context))
	if (unlikely(current->audit_context)) {
		audit_syscall_exit(current, AUDITSC_RESULT(regs.r10), regs.r8);
		int success = AUDITSC_RESULT(regs.r10);
		long result = regs.r8;

		if (success != AUDITSC_SUCCESS)
			result = -result;
		audit_syscall_exit(current, success, result);
	}


	if (test_thread_flag(TIF_SYSCALL_TRACE)
	if (test_thread_flag(TIF_SYSCALL_TRACE)
	    && (current->ptrace & PT_PTRACED))
	    && (current->ptrace & PT_PTRACED))