Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73430
b: refs/heads/master
c: ac93a39
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Nov 10, 2007
1 parent 6fa03d1 commit a7d906e
Show file tree
Hide file tree
Showing 6 changed files with 951 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3902beb48d369d5e19f66acc2f857865ddc9b3bf
refs/heads/master: ac93a3946b676025fa55356180e8321639744b31
19 changes: 13 additions & 6 deletions trunk/arch/x86/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,20 @@ sysenter_do_call:

sysenter_tracesys:
CFI_RESTORE_STATE
xchgl %r9d,%ebp
SAVE_REST
CLEAR_RREGS
movq %r9,R9(%rsp)
movq $-ENOSYS,RAX(%rsp) /* really needed? */
movq %rsp,%rdi /* &pt_regs -> arg1 */
call syscall_trace_enter
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
xchgl %ebp,%r9d
movl %ebp, %ebp
/* no need to do an access_ok check here because rbp has been
32bit zero extended */
1: movl (%rbp),%r9d
.section __ex_table,"a"
.quad 1b,ia32_badarg
.previous
jmp sysenter_do_call
CFI_ENDPROC
ENDPROC(ia32_sysenter_target)
Expand Down Expand Up @@ -258,17 +262,20 @@ cstar_do_call:

cstar_tracesys:
CFI_RESTORE_STATE
xchgl %r9d,%ebp
SAVE_REST
CLEAR_RREGS
movq %r9,R9(%rsp)
movq $-ENOSYS,RAX(%rsp) /* really needed? */
movq %rsp,%rdi /* &pt_regs -> arg1 */
call syscall_trace_enter
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
xchgl %ebp,%r9d
movl RSP-ARGOFFSET(%rsp), %r8d
/* no need to do an access_ok check here because r8 has been
32bit zero extended */
1: movl (%r8),%r9d
.section __ex_table,"a"
.quad 1b,ia32_badarg
.previous
jmp cstar_do_call
END(ia32_cstar_target)

Expand Down
10 changes: 8 additions & 2 deletions trunk/arch/x86/ia32/ptrace32.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data)
return ret;
}

#define COMPAT_GDT_ENTRY_TLS_MIN 6

asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
{
struct task_struct *child;
Expand All @@ -246,8 +248,6 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
case PTRACE_SYSCALL:
case PTRACE_OLDSETOPTIONS:
case PTRACE_SETOPTIONS:
case PTRACE_SET_THREAD_AREA:
case PTRACE_GET_THREAD_AREA:
return sys_ptrace(request, pid, addr, data);

default:
Expand All @@ -271,6 +271,12 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
case PTRACE_SETSIGINFO:
case PTRACE_GETSIGINFO:
return ptrace32_siginfo(request, pid, addr, data);

case PTRACE_SET_THREAD_AREA:
case PTRACE_GET_THREAD_AREA:
return sys_ptrace(request, pid,
addr + GDT_ENTRY_TLS_MIN - COMPAT_GDT_ENTRY_TLS_MIN,
data);
}

child = ptrace_get_task_struct(pid);
Expand Down
Loading

0 comments on commit a7d906e

Please sign in to comment.