Skip to contentSkip to conversation

audit mips fix

PATCH In review [email protected] 4 participants 5 messages Mar 5, 2005 – Mar 14, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/5 audit mips fix

From: Yoichi Yuasa <[email protected]>

CC arch/mips/kernel/ptrace.o
arch/mips/kernel/ptrace.c: In function 'do_syscall_trace':
arch/mips/kernel/ptrace.c:310: warning: implicit declaration of function 'audit_syscall_entry' arch/mips/kernel/ptrace.c:310: error: 'struct pt_regs' has no member named 'orig_eax' arch/mips/kernel/ptrace.c:314: warning: implicit declaration of function 'audit_syscall_exit'

---

 25-akpm/arch/mips/kernel/ptrace.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
arch/mips/kernel/ptrace.c renamed from arch/mips/kernel/ptrace.c~audit-mips-fix +2 -1
diff -puN arch/mips/kernel/ptrace.c~audit-mips-fix arch/mips/kernel/ptrace.c
@@ -21,6 +21,7 @@
 #include <linux/mm.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
+#include <linux/audit.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/user.h>
@@ -307,7 +308,7 @@ asmlinkage void do_syscall_trace(struct 
 {
 	if (unlikely(current->audit_context)) {
 		if (!entryexit)
-			audit_syscall_entry(current, regs->orig_eax,
+			audit_syscall_entry(current, regs->regs[2],
 			                    regs->regs[4], regs->regs[5],
 			                    regs->regs[6], regs->regs[7]);
 		else

_

#1 lore raw
Quoted 11 lines · On Fri, Mar 04, 2005 at 01:16:57PM -0800, [email protected] wrote:

From: Yoichi Yuasa <[email protected]>

CC arch/mips/kernel/ptrace.o
arch/mips/kernel/ptrace.c: In function 'do_syscall_trace':
arch/mips/kernel/ptrace.c:310: warning: implicit declaration of function 'audit_syscall_entry' arch/mips/kernel/ptrace.c:310: error: 'struct pt_regs' has no member named 'orig_eax' arch/mips/kernel/ptrace.c:314: warning: implicit declaration of function 'audit_syscall_exit'

Added to the -stable queue, thanks.

greg k-h

#2 lore raw
In reply to [email protected]

arch/mips/kernel/ptrace.c asmlinkage void do_syscall_trace(struct · line 311

Quoted 9 lines · On Fri, Mar 04, 2005 at 01:16:57PM -0800, [email protected] wrote:
arch/mips/kernel/ptrace.c renamed from arch/mips/kernel/ptrace.c~audit-mips-fix +1 -1
@@ -307,7 +308,7 @@ asmlinkage void do_syscall_trace(struct 
 {
 	if (unlikely(current->audit_context)) {
 		if (!entryexit)
-			audit_syscall_entry(current, regs->orig_eax,
+			audit_syscall_entry(current, regs->regs[2],

Wrong. regs[2] can will contain the syscall return value and can be modified by ptrace also.

Ralf

#3 lore raw

Hi Ralf,

Quoted 5 lines · On Thu, 10 Mar 2005 17:14:29 +0000 Ralf Baechle <[email protected]> wrote:
Quoted 2 lines · On Fri, Mar 04, 2005 at 01:16:57PM -0800, [email protected] wrote:
Quoted 9 lines

arch/mips/kernel/ptrace.c asmlinkage void do_syscall_trace(struct · line 311

Quoted 6 lines
arch/mips/kernel/ptrace.c renamed from arch/mips/kernel/ptrace.c~audit-mips-fix +1 -1
@@ -307,7 +308,7 @@ asmlinkage void do_syscall_trace(struct 
 {
 	if (unlikely(current->audit_context)) {
 		if (!entryexit)
-			audit_syscall_entry(current, regs->orig_eax,
+			audit_syscall_entry(current, regs->regs[2],

Wrong. regs[2] can will contain the syscall return value and can be modified by ptrace also.

Thank you for your comment,
I consider a good way based on your comment.

Do you already have a good idea?

Yoichi

#4 lore raw
Quoted 13 lines · Yoichi Yuasa
Quoted 12 lines

arch/mips/kernel/ptrace.c asmlinkage void do_syscall_trace(struct · line 311

Quoted 9 lines
arch/mips/kernel/ptrace.c renamed from arch/mips/kernel/ptrace.c~audit-mips-fix +1 -1
@@ -307,7 +308,7 @@ asmlinkage void do_syscall_trace(struct 
 {
 	if (unlikely(current->audit_context)) {
 		if (!entryexit)
-			audit_syscall_entry(current, regs->orig_eax,
+			audit_syscall_entry(current, regs->regs[2],

Wrong. regs[2] can will contain the syscall return value and can be modified by ptrace also.

Quoted 4 lines

Thank you for your comment,
I consider a good way based on your comment.

Do you already have a good idea?

Basically do what x86 did, keep a copy of the the original regs[2] around. The only potencial problem with this approach is debuggers might be affected so I want to look into that first.

Ralf