uprobes: _register() should always do register_for_each_vma(true)
authorOleg Nesterov <oleg@redhat.com>
Fri, 23 Nov 2012 19:15:17 +0000 (20:15 +0100)
committerOleg Nesterov <oleg@redhat.com>
Fri, 8 Feb 2013 16:47:03 +0000 (17:47 +0100)
commit9a98e03cc145c994da824dac7602334f50feb670
tree66ab8762b473ea81531aa17395e9678beae22f61
parent04aab9b2006bbdeff78dc162f206fdfebeca97d9
uprobes: _register() should always do register_for_each_vma(true)

To support the filtering uprobe_register() should do
register_for_each_vma(true) every time the new consumer comes,
we need to install the previously nacked breakpoints.

Note:
- uprobes_mutex[] should die, what it actually protects is
  alloc_uprobe().

- UPROBE_RUN_HANDLER should die too, obviously it can't work
  unless uprobe has a single consumer. The consumer should
  serialize with _register/_unregister itself. Or this flag
  should live in uprobe_consumer->state.

- Perhaps we can do some optimizations later. For example, if
  filter_chain() never returns false uprobe can record this
  fact and avoid the unnecessary register_for_each_vma().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
kernel/events/uprobes.c