Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 936cf251 authored by David S. Miller's avatar David S. Miller
Browse files

sparc: Validate that kprobe address is 4-byte aligned.



Otherwise it isn't a valid instruction address.

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

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 08a036d5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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]);