[PATCH 8/9] ARM: support uprobe handling

Rabin Vincent rabin at rab.in
Mon Nov 12 12:26:02 EST 2012


2012/11/4 Russell King - ARM Linux <linux at arm.linux.org.uk>
> On Sun, Oct 14, 2012 at 09:23:12PM +0200, Rabin Vincent wrote:
> > Extend the kprobes code to handle user-space probes.  Much of the code
> > can be reused so currently the ARM uprobes code reuses the kprobes
> > structures.  The decode tables are reused, with the modification that
> > for those instruction that require custom decoding for uprobes, a new
> > element is added in the table to specify a custom decoder function.
>
> How are accesses to userspace handled by the kprobes code?  Please point
> me to where these accesses are performed.

If you mean the accesses where we write the probe opcode, this is done
in write_opcode() in kernel/events/uprobes.c

If you instead mean the accesses which load/store instructions would
perform, this is done from userspace itself, by placing the modified
instruction in an executable area which is mapped to userspace, and
modifying the PC to point there.  See xol_get_insn_slot() in
kernel/events/uprobes.c



More information about the linux-arm-kernel mailing list