diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-09-30 20:31:41 +0200 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2012-10-07 21:19:43 +0200 |
commit | 4710f05fd146d4739e57a8832a3abc5bd3bf0997 (patch) | |
tree | 459f64b5243d621c85b34abf90e3892cca69e502 /kernel/params.c | |
parent | cb9a19fe4aa51afa34786bd383e6614fa0083d58 (diff) | |
download | op-kernel-dev-4710f05fd146d4739e57a8832a3abc5bd3bf0997.zip op-kernel-dev-4710f05fd146d4739e57a8832a3abc5bd3bf0997.tar.gz |
uprobes: Fix prepare_uprobe() race with itself
install_breakpoint() is called under mm->mmap_sem, this protects
set_swbp() but not prepare_uprobe(). Two or more different tasks
can call install_breakpoint()->prepare_uprobe() at the same time,
this leads to numerous problems if UPROBE_COPY_INSN is not set.
Just for example, the second copy_insn() can corrupt the already
analyzed/fixuped uprobe->arch.insn and race with handle_swbp().
This patch simply adds uprobe->copy_mutex to serialize this code.
We could probably reuse ->consumer_rwsem, but this would mean that
consumer->handler() can not use mm->mmap_sem, not good.
Note: this is another temporary ugly hack until we move this logic
into uprobe_register().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/params.c')
0 files changed, 0 insertions, 0 deletions