Skip to content

Commit

Permalink
sparc: Validate that kprobe address is 4-byte aligned.
Browse files Browse the repository at this point in the history
Otherwise it isn't a valid instruction address.

This is the sparc equivalent of commit
b46b3d7 (kprobes: Checks probe
address is instruction boudary on x86)

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Dec 10, 2009
1 parent 08a036d commit 936cf25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/sparc/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit 936cf25

Please sign in to comment.