Commit 986bef85 authored by David S. Miller's avatar David S. Miller

sparc: Fix ptrace() detach.

Forever we had a PTRACE_SUNOS_DETACH which was unconditionally
recognized, regardless of the personality of the process.

Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h
header file on sparc as PTRACE_DETACH and PT_DETACH.

So continue to recognize this old value.  Luckily, it doesn't conflict
with anything we actually care about.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c07c6053
...@@ -441,6 +441,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -441,6 +441,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break; break;
default: default:
if (request == PTRACE_SPARC_DETACH)
request = PTRACE_DETACH;
ret = ptrace_request(child, request, addr, data); ret = ptrace_request(child, request, addr, data);
break; break;
} }
......
...@@ -944,6 +944,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -944,6 +944,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
break; break;
default: default:
if (request == PTRACE_SPARC_DETACH)
request = PTRACE_DETACH;
ret = compat_ptrace_request(child, request, addr, data); ret = compat_ptrace_request(child, request, addr, data);
break; break;
} }
...@@ -1036,6 +1038,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -1036,6 +1038,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break; break;
default: default:
if (request == PTRACE_SPARC_DETACH)
request = PTRACE_DETACH;
ret = ptrace_request(child, request, addr, data); ret = ptrace_request(child, request, addr, data);
break; break;
} }
......
...@@ -149,6 +149,7 @@ extern void show_regs(struct pt_regs *); ...@@ -149,6 +149,7 @@ extern void show_regs(struct pt_regs *);
#define SF_XXARG 0x5c #define SF_XXARG 0x5c
/* Stuff for the ptrace system call */ /* Stuff for the ptrace system call */
#define PTRACE_SPARC_DETACH 11
#define PTRACE_GETREGS 12 #define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13 #define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14 #define PTRACE_GETFPREGS 14
......
...@@ -298,6 +298,7 @@ extern void __show_regs(struct pt_regs *); ...@@ -298,6 +298,7 @@ extern void __show_regs(struct pt_regs *);
#define SF_XXARG 0x5c #define SF_XXARG 0x5c
/* Stuff for the ptrace system call */ /* Stuff for the ptrace system call */
#define PTRACE_SPARC_DETACH 11
#define PTRACE_GETREGS 12 #define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13 #define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14 #define PTRACE_GETFPREGS 14
......
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