alistair23-linux/kernel/events
Oleg Nesterov 75ed82ea53 uprobes: Change write_opcode() to use FOLL_FORCE
write_opcode()->get_user_pages() needs FOLL_FORCE to ensure we can
read the page even if the probed task did mprotect(PROT_NONE) after
uprobe_register(). Without FOLL_WRITE, FOLL_FORCE doesn't have any
side effect but allows to read the !VM_READ memory.

Otherwiese the subsequent uprobe_unregister()->set_orig_insn() fails
and we leak "int3". If that task does mprotect(PROT_READ | EXEC) and
execute the probed insn later it will be killed.

Note: in fact this is also needed for _register, see the next patch.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
2012-09-29 21:21:53 +02:00
..
callchain.c perf: Add attribute to filter out callchains 2012-08-10 12:40:57 -03:00
core.c perf: Add ability to attach user stack dump to sample 2012-08-10 12:17:58 -03:00
hw_breakpoint.c Merge branch 'x86/cleanups' into perf/uprobes 2012-03-13 16:33:03 +01:00
internal.h perf: Add ability to attach user stack dump to sample 2012-08-10 12:17:58 -03:00
Makefile uprobes: Move to kernel/events/ 2012-02-22 11:08:00 +01:00
ring_buffer.c perf: Add perf_output_skip function to skip bytes in sample 2012-08-10 12:16:22 -03:00
uprobes.c uprobes: Change write_opcode() to use FOLL_FORCE 2012-09-29 21:21:53 +02:00