Re: [PATCH 8/9] ARM: support uprobe handling

From: Rabin Vincent
Date: Mon Nov 12 2012 - 12:26:31 EST


2012/11/4 Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/