Commit 3f6ffc8c2087791920721f086f9a92fde7bed9e2
1 parent
abdf8b5e07
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
openrisc: Fix up audit_syscall_[entry|exit]() usage
Commits d7e7528bcd456f5c36ad4a202ccfb43c5aa98bc4 and b05d8447e7821695bc2fa3359431f7a664232743 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: Jonas Bonn <jonas@southpole.se>
Showing 2 changed files with 11 additions and 9 deletions Side-by-side Diff
arch/openrisc/include/asm/ptrace.h
... | ... | @@ -77,7 +77,6 @@ |
77 | 77 | long syscallno; /* Syscall number (used by strace) */ |
78 | 78 | long dummy; /* Cheap alignment fix */ |
79 | 79 | }; |
80 | -#endif /* __ASSEMBLY__ */ | |
81 | 80 | |
82 | 81 | /* TODO: Rename this to REDZONE because that's what it is */ |
83 | 82 | #define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */ |
... | ... | @@ -86,6 +85,13 @@ |
86 | 85 | #define user_mode(regs) (((regs)->sr & SPR_SR_SM) == 0) |
87 | 86 | #define user_stack_pointer(regs) ((unsigned long)(regs)->sp) |
88 | 87 | #define profile_pc(regs) instruction_pointer(regs) |
88 | + | |
89 | +static inline long regs_return_value(struct pt_regs *regs) | |
90 | +{ | |
91 | + return regs->gpr[11]; | |
92 | +} | |
93 | + | |
94 | +#endif /* __ASSEMBLY__ */ | |
89 | 95 | |
90 | 96 | /* |
91 | 97 | * Offsets used by 'ptrace' system call interface. |
arch/openrisc/kernel/ptrace.c
... | ... | @@ -188,11 +188,9 @@ |
188 | 188 | */ |
189 | 189 | ret = -1L; |
190 | 190 | |
191 | - /* Are these regs right??? */ | |
192 | - if (unlikely(current->audit_context)) | |
193 | - audit_syscall_entry(audit_arch(), regs->syscallno, | |
194 | - regs->gpr[3], regs->gpr[4], | |
195 | - regs->gpr[5], regs->gpr[6]); | |
191 | + audit_syscall_entry(audit_arch(), regs->syscallno, | |
192 | + regs->gpr[3], regs->gpr[4], | |
193 | + regs->gpr[5], regs->gpr[6]); | |
196 | 194 | |
197 | 195 | return ret ? : regs->syscallno; |
198 | 196 | } |
... | ... | @@ -201,9 +199,7 @@ |
201 | 199 | { |
202 | 200 | int step; |
203 | 201 | |
204 | - if (unlikely(current->audit_context)) | |
205 | - audit_syscall_exit(AUDITSC_RESULT(regs->gpr[11]), | |
206 | - regs->gpr[11]); | |
202 | + audit_syscall_exit(regs); | |
207 | 203 | |
208 | 204 | step = test_thread_flag(TIF_SINGLESTEP); |
209 | 205 | if (step || test_thread_flag(TIF_SYSCALL_TRACE)) |