diff options
author | Bryan Cantrill <bryan@joyent.com> | 2015-06-05 18:53:19 +0000 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2015-06-05 18:53:19 +0000 |
commit | f678cef01a1f7e4c11d44044991bee1a3b3c0823 (patch) | |
tree | 2490c85defcf5942785d49ca3c8292052a8c54a7 | |
parent | e34388d67f91488dcf7bc14e66bdededfe2a10e4 (diff) | |
download | illumos-joyent-f678cef01a1f7e4c11d44044991bee1a3b3c0823.tar.gz |
OS-4386 lx brand: PTRACE_POKEUSER misbehaves for 64-bit values
-rw-r--r-- | usr/src/lib/brand/lx/lx_brand/common/ptrace.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/ptrace.c b/usr/src/lib/brand/lx/lx_brand/common/ptrace.c index 5cdbf1da87..57bcb5a2da 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/ptrace.c +++ b/usr/src/lib/brand/lx/lx_brand/common/ptrace.c @@ -630,7 +630,8 @@ ptrace_poke(pid_t pid, uintptr_t addr, int data) } static int -ptrace_poke_user(pid_t lxpid, pid_t pid, lwpid_t lwpid, uintptr_t off, int data) +ptrace_poke_user(pid_t lxpid, pid_t pid, lwpid_t lwpid, + uintptr_t off, long data) { lx_user_regs_t regs; int err = 0; @@ -646,7 +647,7 @@ ptrace_poke_user(pid_t lxpid, pid_t pid, lwpid_t lwpid, uintptr_t off, int data) return (err); } - *(int *)((uintptr_t)®s + off - + *(long *)((uintptr_t)®s + off - offsetof(lx_user_t, lxu_regs)) = data; return (lx_ptrace_kernel(LX_PTRACE_SETREGS, lxpid, NULL, @@ -866,7 +867,7 @@ lx_ptrace(uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4) return (ptrace_poke(pid, p3, (int)p4)); case LX_PTRACE_POKEUSER: - return (ptrace_poke_user(lxpid, pid, lwpid, p3, (int)p4)); + return (ptrace_poke_user(lxpid, pid, lwpid, p3, (long)p4)); case LX_PTRACE_KILL: return (ptrace_kill(pid)); |