projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67db392
)
xtensa: prevent arbitrary read in ptrace
author
Dan Rosenberg
<
[email protected]
>
Tue, 26 Jul 2011 00:11:53 +0000
(17:11 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 26 Jul 2011 03:57:07 +0000
(20:57 -0700)
Prevent an arbitrary kernel read. Check the user pointer with access_ok()
before copying data in.
[
[email protected]
: s/EIO/EFAULT/]
Signed-off-by: Dan Rosenberg <
[email protected]
>
Cc: Christian Zankel <
[email protected]
>
Cc: Oleg Nesterov <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
arch/xtensa/kernel/ptrace.c
patch
|
blob
|
history
diff --git
a/arch/xtensa/kernel/ptrace.c
b/arch/xtensa/kernel/ptrace.c
index c72c9473ef9913f9666ff54f869fe35fdfd27509..a0d042aa296755e441fe4266a7103b315a581a34 100644
(file)
--- a/
arch/xtensa/kernel/ptrace.c
+++ b/
arch/xtensa/kernel/ptrace.c
@@
-147,6
+147,9
@@
int ptrace_setxregs(struct task_struct *child, void __user *uregs)
elf_xtregs_t *xtregs = uregs;
int ret = 0;
+ if (!access_ok(VERIFY_READ, uregs, sizeof(elf_xtregs_t)))
+ return -EFAULT;
+
#if XTENSA_HAVE_COPROCESSORS
/* Flush all coprocessors before we overwrite them. */
coprocessor_flush_all(ti);