Oleg Nesterov 704b836cbf mm_for_maps: take ->cred_guard_mutex to fix the race with exec
The problem is minor, but without ->cred_guard_mutex held we can race
with exec() and get the new ->mm but check old creds.

Now we do not need to re-check task->mm after ptrace_may_access(), it
can't be changed to the new mm under us.

Strictly speaking, this also fixes another very minor problem. Unless
security check fails or the task exits mm_for_maps() should never
return NULL, the caller should get either old or new ->mm.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
2009-08-10 20:49:26 +10:00
..
2009-07-12 12:22:34 -07:00
2009-06-11 21:36:14 -04:00
2009-07-12 12:24:07 -07:00
2009-06-11 21:36:01 -04:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-06-24 08:15:24 -04:00
2009-07-14 12:28:43 -05:00
2009-06-17 00:36:36 -04:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-05-22 18:40:59 +10:00
2009-07-10 19:18:59 -07:00
2009-07-12 12:22:34 -07:00
2009-06-15 21:44:43 -07:00
2009-07-12 12:22:34 -07:00
2009-06-15 21:44:43 -07:00
2009-07-12 12:22:34 -07:00
2009-06-11 21:36:13 -04:00
2009-06-11 21:36:12 -04:00
2009-07-30 17:31:23 +02:00
2009-07-12 12:22:34 -07:00
2009-06-11 21:36:07 -04:00
2009-07-12 12:22:34 -07:00
2009-06-17 00:36:37 -04:00
2009-07-12 12:22:34 -07:00
2009-06-18 13:03:46 -07:00
2009-06-30 18:55:58 -07:00
2009-07-01 11:14:28 -07:00
2009-07-12 12:22:34 -07:00
2009-07-12 12:22:34 -07:00
2009-06-11 21:36:06 -04:00
2009-06-18 13:03:41 -07:00
2009-07-12 12:22:34 -07:00
2009-03-31 23:00:26 -04:00
2009-08-07 14:38:29 -03:00
2009-06-11 21:36:07 -04:00
2009-07-14 12:34:17 +09:00
2009-06-11 21:36:11 -04:00
2009-04-07 08:31:16 -07:00
2009-04-20 23:02:52 -04:00
2009-06-11 21:36:02 -04:00