Files
android_kernel_xiaomi_sm8450/include/linux
Srikar Dronamraju cbc91f71b5 uprobes/core: Decrement uprobe count before the pages are unmapped
Uprobes has a callback (uprobe_munmap()) in the unmap path to
maintain the uprobes count.

In the exit path this callback gets called in unlink_file_vma().
However by the time unlink_file_vma() is called, the pages would
have been unmapped (in unmap_vmas()) and the task->rss_stat counts
accounted (in zap_pte_range()).

If the exiting process has probepoints, uprobe_munmap() checks if
the breakpoint instruction was around before decrementing the probe
count.

This results in a file backed page being reread by uprobe_munmap()
and hence it does not find the breakpoint.

This patch fixes this problem by moving the callback to
unmap_single_vma(). Since unmap_single_vma() may not unmap the
complete vma, add start and end parameters to uprobe_munmap().

This bug became apparent courtesy of commit c3f0327f8e
("mm: add rss counters consistency check").

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120411103527.23245.9835.sendpatchset@srdronam.in.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-04-14 13:25:48 +02:00
..
2009-06-17 00:36:36 -04:00
2011-07-22 08:25:37 -07:00
2011-11-02 16:07:03 -07:00
2011-07-20 20:47:43 -04:00
2009-09-08 17:42:50 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2008-12-03 22:12:38 -08:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2011-10-26 15:43:25 -04:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2009-04-01 08:59:23 -07:00
2011-03-22 17:43:59 -07:00
2005-04-16 15:20:36 -07:00
2008-10-20 08:52:42 -07:00
2009-01-30 23:40:06 +05:30
2012-03-20 21:29:46 -04:00
2011-08-03 11:30:42 -04:00
2011-07-31 22:05:09 +02:00
2009-11-20 20:13:39 +01:00
2011-07-26 16:49:47 -07:00
2011-03-31 11:26:23 -03:00
2012-03-21 17:55:01 -07:00
2012-03-16 20:35:02 +00:00
2012-03-16 20:35:02 +00:00
2005-04-16 15:20:36 -07:00
2012-02-28 16:02:54 +01:00
2012-01-03 22:54:57 -05:00
2011-10-29 21:20:22 +02:00
2012-03-29 15:38:31 +10:30
2007-07-17 10:23:04 -07:00
2012-03-23 16:58:38 -07:00
2011-07-06 14:44:42 -07:00
2011-07-25 20:57:16 -07:00
2011-12-13 09:26:45 +00:00
2012-03-20 21:29:37 -04:00
2011-07-05 23:42:17 -07:00
2012-03-20 21:29:53 -04:00
2012-02-20 19:46:36 +11:00
2012-01-04 08:56:31 -06:00
2011-10-31 20:19:04 +00:00
2007-02-09 17:39:36 -05:00
2009-01-30 23:46:40 +05:30
2011-11-26 14:59:39 -05:00
2012-03-28 18:30:03 +01:00
2011-12-11 18:25:16 -05:00
2012-01-12 20:13:04 -08:00
2011-09-14 15:24:51 -04:00
2011-03-31 11:26:23 -03:00
2006-03-31 12:18:54 -08:00
2011-01-12 20:16:43 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2011-01-07 17:50:27 +11:00
2012-04-05 15:30:34 -07:00
2011-12-13 11:58:49 +01:00
2012-02-28 17:10:21 +00:00
2007-07-10 00:35:17 -04:00
2010-10-25 14:11:37 -07:00
2011-07-01 15:34:45 -07:00
2009-09-01 01:13:31 -07:00
2010-02-09 11:13:56 +01:00
2011-06-27 16:06:19 -07:00
2010-10-12 16:53:37 +02:00
2005-04-16 15:20:36 -07:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2011-02-23 00:53:26 +00:00
2012-03-26 21:47:19 +02:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2012-03-27 22:45:26 -04:00
2009-11-04 09:50:58 -08:00
2005-04-16 15:20:36 -07:00
2009-01-30 23:56:13 +05:30
2008-08-02 18:36:10 +01:00
2011-07-21 13:47:54 -07:00
2005-04-16 15:20:36 -07:00
2006-10-10 15:37:22 -07:00
2012-01-03 22:55:17 -05:00
2009-04-21 13:41:48 -07:00
2006-10-04 00:31:09 -07:00
2010-06-03 03:21:52 -07:00
2011-03-31 11:26:23 -03:00
2012-01-09 13:52:09 +01:00
2010-08-10 11:49:21 -07:00
2012-03-08 10:50:35 -08:00
2011-02-17 11:12:40 -08:00
2012-03-21 17:54:57 -07:00
2012-03-08 10:50:35 -08:00
2012-01-17 15:40:51 -08:00
2011-12-27 11:26:41 +02:00
2011-09-16 19:20:20 -04:00
2012-02-29 15:35:41 -06:00
2009-06-16 19:47:48 -07:00
2012-03-15 21:41:34 +01:00
2012-03-03 15:04:45 -05:00
2009-09-22 07:17:35 -07:00
2009-06-16 08:40:20 +02:00
2009-01-31 00:00:35 +05:30
2012-03-28 17:19:28 -07:00
2011-07-26 16:49:47 -07:00
2005-04-16 15:20:36 -07:00
2006-11-30 04:40:22 +01:00
2008-06-06 11:29:12 -07:00
2011-07-26 16:49:47 -07:00
2011-11-14 00:47:54 -05:00
2012-04-03 17:23:23 -04:00
2009-06-17 18:02:11 -07:00
2012-03-05 15:26:47 -05:00
2010-07-05 16:14:52 -06:00
2012-03-21 17:54:58 -07:00
2012-03-21 17:55:01 -07:00
2007-10-16 09:43:02 -07:00
2005-04-16 15:20:36 -07:00
2011-01-16 13:47:07 -05:00
2012-01-06 12:10:26 -08:00
2012-03-16 21:49:24 +01:00
2011-12-13 09:26:45 +00:00
2006-10-03 23:01:26 +02:00
2011-11-02 16:07:02 -07:00
2011-03-31 11:26:23 -03:00
2009-03-30 15:22:01 +02:00
2012-03-20 21:29:38 -04:00
2012-01-03 22:55:07 -05:00
2010-02-10 17:47:17 -08:00
2005-04-16 15:20:36 -07:00
2010-09-08 18:16:55 -07:00
2009-11-04 09:50:58 -08:00
2010-05-11 10:09:47 +02:00
2012-03-28 18:30:03 +01:00
2010-06-03 03:21:52 -07:00
2011-06-07 10:02:35 +02:00
2008-02-07 08:42:34 -08:00
2012-03-08 11:38:50 -08:00
2012-03-12 22:19:13 +01:00
2012-01-09 09:33:57 +09:00
2011-07-30 08:44:19 -10:00
2012-03-06 11:01:33 +02:00
2012-03-19 16:53:08 -04:00
2011-07-26 16:49:47 -07:00
2011-12-13 09:26:45 +00:00
2011-07-25 20:57:11 -07:00
2008-07-20 17:12:37 -07:00
2007-05-08 11:15:18 -07:00
2010-08-09 16:48:44 -04:00
2011-10-31 17:30:47 -07:00
2011-08-16 00:16:49 -07:00
2005-04-16 15:20:36 -07:00
2012-01-03 22:54:56 -05:00
2012-03-22 19:43:43 -07:00
2010-11-29 08:55:22 +11:00
2006-09-28 17:53:59 -07:00
2012-03-28 18:30:03 +01:00
2011-06-07 09:05:42 -07:00
2011-11-02 16:07:02 -07:00
2010-05-19 22:40:47 -04:00
2012-03-31 08:09:50 +05:30
2011-07-26 16:49:47 -07:00
2012-03-08 10:50:35 -08:00
2012-03-28 18:30:03 +01:00
2011-09-14 15:24:51 -04:00
2011-01-13 08:03:24 -08:00