Konstantin Belousov
7032434e98
When exec_new_vmspace() decides that current vmspace cannot be reused
...
on execve(2), it calls vmspace_exec(), which frees the current
vmspace. The thread executing an exec syscall gets new vmspace
assigned, and old vmspace is freed if only referenced by the current
process. The free operation includes pmap_release(), which
de-constructs the paging structures used by hardware.
If the calling process is multithreaded, other threads are suspended
in the thread_suspend_check(), and need to be unsuspended and run to
be able to exit on successfull exec. Now, since the old vmspace is
destroyed, paging structures are invalid, threads are resumed on the
non-existent pmaps (page tables), which leads to triple fault on x86.
To fix, postpone the free of old vmspace until the threads are resumed
and exited. To avoid modifications to all image activators all of
which use exec_new_vmspace(), memoize the current (old) vmspace in
kern_execve(), and notify it about the need to call vmspace_free()
with a thread-private flag TDP_EXECVMSPC.
http://bugs.debian.org/743141
Reported by: Ivo De Decker <ivo.dedecker@ugent.be> through secteam
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
2014-05-20 09:19:35 +00:00
..
2013-05-09 00:04:59 +00:00
2013-03-04 11:09:56 +00:00
2013-05-09 00:04:59 +00:00
2011-11-19 14:10:16 +00:00
2011-12-16 10:56:16 +00:00
2012-11-11 23:25:47 +00:00
2011-12-27 21:36:31 +00:00
2013-05-12 04:05:01 +00:00
2013-06-25 18:44:15 +00:00
2014-02-05 18:13:27 +00:00
2011-05-09 22:13:07 +00:00
2013-10-18 11:25:08 +00:00
2013-09-05 00:09:56 +00:00
2014-03-18 21:32:03 +00:00
2013-08-30 07:37:45 +00:00
2011-02-21 09:01:34 +00:00
2011-04-09 07:42:25 +00:00
2012-05-22 10:59:26 +00:00
2013-06-08 13:27:57 +00:00
2012-05-25 20:33:34 +00:00
2014-04-24 01:28:14 +00:00
2013-03-23 16:55:07 +00:00
2013-08-30 07:43:34 +00:00
2014-03-11 10:13:06 +00:00
2014-03-30 23:43:36 +00:00
2013-08-22 18:26:45 +00:00
2013-11-20 13:22:22 +00:00
2014-03-18 01:40:25 +00:00
2013-06-27 20:21:54 +00:00
2012-12-20 00:34:54 +00:00
2013-08-23 14:40:17 +00:00
2014-03-16 21:05:00 +00:00
2013-09-05 00:09:56 +00:00
2014-04-19 22:18:57 +00:00
2013-06-16 10:48:47 +00:00
2012-01-15 13:23:18 +00:00
2013-04-19 20:03:51 +00:00
2013-03-04 12:20:48 +00:00
2013-08-24 04:52:22 +00:00
2011-12-17 15:39:14 +00:00
2013-12-21 13:58:55 +00:00
2013-12-31 12:18:10 +00:00
2013-10-15 10:05:37 +00:00
2013-08-30 07:43:34 +00:00
2013-10-16 09:12:40 +00:00
2011-06-14 17:10:32 +00:00
2012-05-25 20:33:34 +00:00
2013-03-07 22:32:41 +00:00
2013-08-07 00:00:48 +00:00
2013-03-19 20:58:17 +00:00
2013-12-26 03:19:08 +00:00
2012-01-15 13:23:18 +00:00
2014-03-27 13:57:00 +00:00
2014-01-16 21:50:26 +00:00
2013-05-04 19:07:22 +00:00
2014-04-07 18:10:49 +00:00
2014-02-28 19:21:07 +00:00
2013-10-21 16:44:53 +00:00
2013-04-02 05:30:41 +00:00
2013-12-23 18:09:10 +00:00
2014-04-17 21:29:22 +00:00
2013-12-01 03:53:21 +00:00
2014-04-04 05:07:36 +00:00
2012-12-14 12:37:35 +00:00
2013-12-27 07:02:07 +00:00
2012-09-04 12:07:33 +00:00
2013-06-15 04:03:40 +00:00
2012-05-21 02:30:22 +00:00
2012-06-28 07:37:46 +00:00
2014-04-08 22:12:01 +00:00
2012-01-15 13:23:18 +00:00
2011-07-18 15:19:40 +00:00
2012-10-22 02:59:55 +00:00
2014-01-31 17:39:51 +00:00
2011-07-17 08:19:19 +00:00
2012-12-10 23:12:51 +00:00
2014-05-06 10:53:51 +00:00
2011-04-12 08:13:18 +00:00
2011-11-15 20:11:03 +00:00
2013-05-03 21:11:57 +00:00
2013-12-02 22:34:47 +00:00
2013-12-02 22:34:47 +00:00
2013-09-05 00:09:56 +00:00
2013-07-27 20:47:01 +00:00
2011-03-04 19:28:27 +00:00
2013-08-13 03:09:00 +00:00
2014-01-28 17:27:54 +00:00
2013-09-29 18:02:23 +00:00
2011-12-12 23:29:32 +00:00
2011-03-29 17:47:25 +00:00
2013-06-28 03:51:20 +00:00
2013-08-25 10:57:09 +00:00
2014-05-04 23:25:32 +00:00
2011-11-18 03:05:20 +00:00
2013-12-04 07:38:23 +00:00
2013-02-12 16:57:20 +00:00
2013-09-09 18:11:59 +00:00
2013-06-15 10:38:31 +00:00
2013-11-09 22:28:04 +00:00
2013-09-02 19:49:18 +00:00
2011-04-06 16:59:54 +00:00
2012-03-19 00:36:32 +00:00
2014-05-02 07:57:40 +00:00
2013-09-05 00:09:56 +00:00
2014-05-15 15:50:37 +00:00
2014-01-20 20:56:09 +00:00
2014-02-10 19:47:14 +00:00
2013-12-28 21:31:58 +00:00
2014-05-02 00:52:13 +00:00
2014-05-15 18:53:02 +00:00
2014-01-07 14:03:42 +00:00
2012-03-28 20:58:30 +00:00
2011-09-16 13:58:51 +00:00
2011-05-13 05:27:58 +00:00
2014-03-15 00:57:50 +00:00
2014-05-20 09:19:35 +00:00
2013-09-19 18:53:42 +00:00
2014-04-07 18:10:49 +00:00
2013-03-02 21:11:30 +00:00
2012-02-11 14:49:25 +00:00
2013-06-18 02:57:56 +00:00
2012-10-26 16:01:08 +00:00
2014-01-18 06:14:38 +00:00
2013-08-15 20:19:17 +00:00
2012-10-26 16:01:08 +00:00
2014-02-05 18:13:27 +00:00
2013-10-21 16:44:53 +00:00
2013-10-21 16:44:53 +00:00
2012-02-27 18:28:31 +00:00
2013-06-25 18:44:15 +00:00
2014-02-05 18:13:27 +00:00
2013-04-11 19:49:18 +00:00
2013-07-24 09:45:31 +00:00
2013-11-26 08:49:53 +00:00
2014-04-28 13:42:41 +00:00
2011-08-25 15:51:54 +00:00
2011-07-14 14:18:14 +00:00
2014-01-17 05:26:55 +00:00
2013-09-22 13:36:52 +00:00
2014-01-17 05:26:55 +00:00
2014-01-13 04:41:08 +00:00
2011-04-06 16:59:54 +00:00
2012-03-26 19:12:09 +00:00
2013-03-18 17:23:58 +00:00
2014-02-05 18:13:27 +00:00
2012-05-22 08:33:14 +00:00
2014-04-26 20:27:54 +00:00
2014-03-13 18:42:12 +00:00
2014-02-25 18:44:33 +00:00
2013-09-16 06:25:54 +00:00
2014-03-15 06:49:32 +00:00
2011-06-29 08:32:37 +00:00
2011-11-16 19:06:55 +00:00
2014-05-11 13:48:21 +00:00
2014-04-01 14:46:11 +00:00
2011-05-05 02:35:25 +00:00
2012-06-24 04:15:58 +00:00
2013-11-25 07:38:45 +00:00
2014-03-18 21:34:11 +00:00
2014-03-18 21:34:11 +00:00
2013-09-19 18:53:42 +00:00
2014-02-25 18:44:33 +00:00
2012-06-23 10:14:51 +00:00
2013-04-09 16:16:34 +00:00
2014-03-18 21:34:11 +00:00
2014-04-02 15:56:11 +00:00
2013-11-28 18:56:34 +00:00
2013-12-23 18:09:10 +00:00
2014-04-12 23:29:29 +00:00
2014-04-02 15:56:11 +00:00
2011-12-24 01:32:01 +00:00
2011-11-21 13:34:29 +00:00
2013-09-20 05:06:03 +00:00
2013-05-21 21:50:11 +00:00
2013-12-18 12:50:43 +00:00
2012-02-06 18:15:46 +00:00
2013-04-09 16:16:34 +00:00
2011-07-02 13:54:20 +00:00
2014-02-05 18:13:27 +00:00
2013-09-05 00:09:56 +00:00
2013-05-28 04:54:16 +00:00
2011-03-05 12:40:35 +00:00
2013-09-16 06:25:54 +00:00
2014-03-18 21:32:03 +00:00
2013-02-01 15:32:20 +00:00
2012-08-17 02:26:31 +00:00
2014-03-13 18:42:12 +00:00
2014-05-02 21:41:35 +00:00
2013-07-24 04:24:21 +00:00
2013-01-30 12:48:16 +00:00
2013-06-28 03:51:20 +00:00
2014-03-22 10:26:09 +00:00
2013-07-09 20:49:32 +00:00
2012-05-25 20:33:34 +00:00
2013-08-11 14:15:01 +00:00
2013-02-27 19:03:31 +00:00