Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66005
b: refs/heads/master
c: 2615639
h: refs/heads/master
i:
  66003: e42f81f
v: v3
  • Loading branch information
Jie Zhang authored and Bryan Wu committed Aug 5, 2007
1 parent 73637b9 commit 252c4c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 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: 8a26ac7043b0cb3b446ad9f9a3ec0992d0fea1f7
refs/heads/master: 2615639758c0a9e0f0e14267c9cd2b83801eb8cf
24 changes: 18 additions & 6 deletions trunk/arch/blackfin/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <asm/processor.h>
#include <asm/asm-offsets.h>
#include <asm/dma.h>
#include <asm/fixed_code.h>

#define MAX_SHARED_LIBS 3
#define TEXT_OFFSET 0
Expand Down Expand Up @@ -169,6 +170,9 @@ static inline int is_user_addr_valid(struct task_struct *child,
&& start + len <= (unsigned long)sraml->addr + sraml->length)
return 0;

if (start >= FIXED_CODE_START && start + len <= FIXED_CODE_END)
return 0;

return -EIO;
}

Expand Down Expand Up @@ -215,9 +219,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
copied = sizeof(tmp);
} else
#endif
copied =
access_process_vm(child, addr + add, &tmp,
sizeof(tmp), 0);
if (addr + add >= FIXED_CODE_START
&& addr + add + sizeof(tmp) <= FIXED_CODE_END) {
memcpy(&tmp, (const void *)(addr + add), sizeof(tmp));
copied = sizeof(tmp);
} else
copied = access_process_vm(child, addr + add, &tmp,
sizeof(tmp), 0);
pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
if (copied != sizeof(tmp))
break;
Expand Down Expand Up @@ -281,9 +289,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
copied = sizeof(data);
} else
#endif
copied =
access_process_vm(child, addr + add, &data,
sizeof(data), 1);
if (addr + add >= FIXED_CODE_START
&& addr + add + sizeof(data) <= FIXED_CODE_END) {
memcpy((void *)(addr + add), &data, sizeof(data));
copied = sizeof(data);
} else
copied = access_process_vm(child, addr + add, &data,
sizeof(data), 1);
pr_debug("ptrace: copied size %d\n", copied);
if (copied != sizeof(data))
break;
Expand Down

0 comments on commit 252c4c0

Please sign in to comment.