Commit 3f6ffc8c authored by Jonas Bonn's avatar Jonas Bonn

openrisc: Fix up audit_syscall_[entry|exit]() usage

Commits d7e7528b and
b05d8447 simplified the usage of the
audit_syscall_[entry|exit] functions.  Unfortunately, the OpenRISC
architecture didn't get fixed up along with the other architectures when
those patches were pushed.  This makes the relevant changes to this
architecture.
Signed-off-by: default avatarJonas Bonn <jonas@southpole.se>
parent abdf8b5e
...@@ -77,7 +77,6 @@ struct pt_regs { ...@@ -77,7 +77,6 @@ struct pt_regs {
long syscallno; /* Syscall number (used by strace) */ long syscallno; /* Syscall number (used by strace) */
long dummy; /* Cheap alignment fix */ long dummy; /* Cheap alignment fix */
}; };
#endif /* __ASSEMBLY__ */
/* TODO: Rename this to REDZONE because that's what it is */ /* TODO: Rename this to REDZONE because that's what it is */
#define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */ #define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */
...@@ -87,6 +86,13 @@ struct pt_regs { ...@@ -87,6 +86,13 @@ struct pt_regs {
#define user_stack_pointer(regs) ((unsigned long)(regs)->sp) #define user_stack_pointer(regs) ((unsigned long)(regs)->sp)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
static inline long regs_return_value(struct pt_regs *regs)
{
return regs->gpr[11];
}
#endif /* __ASSEMBLY__ */
/* /*
* Offsets used by 'ptrace' system call interface. * Offsets used by 'ptrace' system call interface.
*/ */
......
...@@ -188,11 +188,9 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) ...@@ -188,11 +188,9 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
*/ */
ret = -1L; ret = -1L;
/* Are these regs right??? */ audit_syscall_entry(audit_arch(), regs->syscallno,
if (unlikely(current->audit_context)) regs->gpr[3], regs->gpr[4],
audit_syscall_entry(audit_arch(), regs->syscallno, regs->gpr[5], regs->gpr[6]);
regs->gpr[3], regs->gpr[4],
regs->gpr[5], regs->gpr[6]);
return ret ? : regs->syscallno; return ret ? : regs->syscallno;
} }
...@@ -201,9 +199,7 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) ...@@ -201,9 +199,7 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
{ {
int step; int step;
if (unlikely(current->audit_context)) audit_syscall_exit(regs);
audit_syscall_exit(AUDITSC_RESULT(regs->gpr[11]),
regs->gpr[11]);
step = test_thread_flag(TIF_SINGLESTEP); step = test_thread_flag(TIF_SINGLESTEP);
if (step || test_thread_flag(TIF_SYSCALL_TRACE)) if (step || test_thread_flag(TIF_SYSCALL_TRACE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment