summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-09 23:57:24 -0800
committerDavid S. Miller <davem@davemloft.net>2009-12-09 23:57:24 -0800
commit936cf251787be41833afe2a1e44fbd5fb2adbdb6 (patch)
treed6252bfd62d14db5e135d6e1680083d5b4261870 /arch
parent08a036d583409e3517e3d15b7478d029b25f2cf2 (diff)
downloadlinux-936cf251787be41833afe2a1e44fbd5fb2adbdb6.tar.gz
linux-936cf251787be41833afe2a1e44fbd5fb2adbdb6.tar.bz2
linux-936cf251787be41833afe2a1e44fbd5fb2adbdb6.zip
sparc: Validate that kprobe address is 4-byte aligned.
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/kprobes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c
index 3bc6527c95af..6716584e48ab 100644
--- 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]);