Files
tegra-linux-noble/include/linux
Oleg Nesterov da1816b1ca uprobes: Teach handler_chain() to filter out the probed task
Currrently the are 2 problems with pre-filtering:

1. It is not possible to add/remove a task (mm) after uprobe_register()

2. A forked child inherits all breakpoints and uprobe_consumer can not
   control this.

This patch does the first step to improve the filtering. handler_chain()
removes the breakpoints installed by this uprobe from current->mm if all
handlers return UPROBE_HANDLER_REMOVE.

Note that handler_chain() relies on ->register_rwsem to avoid the race
with uprobe_register/unregister which can add/del a consumer, or even
remove and then insert the new uprobe at the same address.

Perhaps we will add uprobe_apply_mm(uprobe, mm, is_register) and teach
copy_mm() to do filter(UPROBE_FILTER_FORK), but I think this change makes
sense anyway.

Note: instead of checking the retcode from uc->handler, we could add
uc->filter(UPROBE_FILTER_BPHIT). But I think this is not optimal to
call 2 hooks in a row. This buys nothing, and if handler/filter do
something nontrivial they will probably do the same work twice.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
2013-02-08 17:47:11 +01:00
..
2013-01-02 17:36:10 -08:00
2013-01-02 17:36:10 -08:00
2012-12-07 17:02:47 +00:00
2013-01-02 17:36:10 -08:00
2012-11-30 12:37:36 +01:00
2013-01-03 14:34:06 -08:00
2012-12-02 00:05:12 +00:00
2012-12-20 13:57:36 -05:00
2012-12-21 20:23:41 +00:00
2012-11-28 11:54:40 +01:00
2012-11-28 21:49:02 -05:00
2012-11-28 21:49:02 -05:00
2012-12-14 13:05:26 +10:30
2013-01-10 10:57:01 -08:00
2012-12-12 17:38:33 -08:00
2012-12-14 13:06:40 +10:30
2012-12-25 18:45:06 -05:00
2012-12-11 17:22:27 -08:00
2013-01-31 13:07:50 -03:00
2013-01-24 15:37:26 +01:00
2013-01-03 15:57:14 -08:00
2012-12-18 15:02:13 -08:00
2012-12-18 15:02:14 -08:00