projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08a036d
)
sparc: Validate that kprobe address is 4-byte aligned.
author
David S. Miller
<davem@davemloft.net>
Thu, 10 Dec 2009 07:57:24 +0000
(23:57 -0800)
committer
David S. Miller
<davem@davemloft.net>
Thu, 10 Dec 2009 07:57:24 +0000
(23:57 -0800)
Otherwise it isn't a valid instruction address.
This is the sparc equivalent of commit
b46b3d70c9c017d7c4ec49f7f3ffd0af5a622277
(kprobes: Checks probe
address is instruction boudary on x86)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/kprobes.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/sparc/kernel/kprobes.c
b/arch/sparc/kernel/kprobes.c
index 3bc6527c95af3ec3bec6f6c3397d46437d72aee5..6716584e48ab4c052a3d7cf941a1781949f885e6 100644
(file)
--- a/
arch/sparc/kernel/kprobes.c
+++ b/
arch/sparc/kernel/kprobes.c
@@
-46,6
+46,9
@@
struct kretprobe_blackpoint kretprobe_blacklist[] = {{NULL, NULL}};
int __kprobes arch_prepare_kprobe(struct kprobe *p)
{
+ if ((unsigned long) p->addr & 0x3UL)
+ return -EILSEQ;
+
p->ainsn.insn[0] = *p->addr;
flushi(&p->ainsn.insn[0]);