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

Commit a528e21c authored by Rusty Lynch's avatar Rusty Lynch Committed by Linus Torvalds
Browse files

[PATCH] kprobes/ia64: refuse inserting kprobe on slot 1



Without the ability to atomically write 16 bytes, we can not update the
middle slot of a bundle, slot 1, unless we stop the machine first.  This
patch will ensure the ability to robustly insert and remove a kprobe by
refusing to insert a kprobe on slot 1 until a mechanism is in place to
safely handle this case.

Signed-off-by: default avatarRusty Lynch <rusty.lynch@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 97f7943d
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -270,6 +270,13 @@ static int valid_kprobe_addr(int template, int slot, unsigned long addr)
				addr);
				addr);
		return -EINVAL;
		return -EINVAL;
	}
	}

	if (slot == 1 && bundle_encoding[template][1] != L) {
		printk(KERN_WARNING "Inserting kprobes on slot #1 "
		       "is not supported\n");
		return -EINVAL;
	}

	return 0;
	return 0;
}
}