OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A mini-zygote specifically for Native Client. | 5 // A mini-zygote specifically for Native Client. |
6 | 6 |
7 #include "components/nacl/loader/nacl_helper_linux.h" | 7 #include "components/nacl/loader/nacl_helper_linux.h" |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
11 #include <signal.h> | 11 #include <signal.h> |
| 12 #include <stddef.h> |
12 #include <stdio.h> | 13 #include <stdio.h> |
13 #include <stdlib.h> | 14 #include <stdlib.h> |
14 #include <sys/socket.h> | 15 #include <sys/socket.h> |
15 #include <sys/stat.h> | 16 #include <sys/stat.h> |
16 #include <sys/types.h> | 17 #include <sys/types.h> |
17 | 18 |
18 #include <string> | 19 #include <string> |
19 #include <utility> | 20 #include <utility> |
20 #include <vector> | 21 #include <vector> |
21 | 22 |
22 #include "base/at_exit.h" | 23 #include "base/at_exit.h" |
23 #include "base/command_line.h" | 24 #include "base/command_line.h" |
24 #include "base/files/scoped_file.h" | 25 #include "base/files/scoped_file.h" |
25 #include "base/logging.h" | 26 #include "base/logging.h" |
26 #include "base/memory/scoped_ptr.h" | 27 #include "base/memory/scoped_ptr.h" |
27 #include "base/message_loop/message_loop.h" | 28 #include "base/message_loop/message_loop.h" |
28 #include "base/posix/eintr_wrapper.h" | 29 #include "base/posix/eintr_wrapper.h" |
29 #include "base/posix/global_descriptors.h" | 30 #include "base/posix/global_descriptors.h" |
30 #include "base/posix/unix_domain_socket_linux.h" | 31 #include "base/posix/unix_domain_socket_linux.h" |
31 #include "base/process/kill.h" | 32 #include "base/process/kill.h" |
32 #include "base/process/process_handle.h" | 33 #include "base/process/process_handle.h" |
33 #include "base/rand_util.h" | 34 #include "base/rand_util.h" |
| 35 #include "build/build_config.h" |
34 #include "components/nacl/common/nacl_switches.h" | 36 #include "components/nacl/common/nacl_switches.h" |
35 #include "components/nacl/loader/sandbox_linux/nacl_sandbox_linux.h" | 37 #include "components/nacl/loader/sandbox_linux/nacl_sandbox_linux.h" |
36 #include "content/public/common/content_descriptors.h" | 38 #include "content/public/common/content_descriptors.h" |
37 #include "content/public/common/send_zygote_child_ping_linux.h" | 39 #include "content/public/common/send_zygote_child_ping_linux.h" |
38 #include "content/public/common/zygote_fork_delegate_linux.h" | 40 #include "content/public/common/zygote_fork_delegate_linux.h" |
39 #include "ipc/ipc_descriptors.h" | 41 #include "ipc/ipc_descriptors.h" |
40 #include "ipc/ipc_switches.h" | 42 #include "ipc/ipc_switches.h" |
41 #include "sandbox/linux/services/credentials.h" | 43 #include "sandbox/linux/services/credentials.h" |
42 #include "sandbox/linux/services/namespace_sandbox.h" | 44 #include "sandbox/linux/services/namespace_sandbox.h" |
43 | 45 |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 // Now handle requests from the Zygote. | 463 // Now handle requests from the Zygote. |
462 while (true) { | 464 while (true) { |
463 bool request_handled = HandleZygoteRequest( | 465 bool request_handled = HandleZygoteRequest( |
464 kNaClZygoteDescriptor, system_info, nacl_sandbox.get()); | 466 kNaClZygoteDescriptor, system_info, nacl_sandbox.get()); |
465 // Do not turn this into a CHECK() without thinking about robustness | 467 // Do not turn this into a CHECK() without thinking about robustness |
466 // against malicious IPC requests. | 468 // against malicious IPC requests. |
467 DCHECK(request_handled); | 469 DCHECK(request_handled); |
468 } | 470 } |
469 NOTREACHED(); | 471 NOTREACHED(); |
470 } | 472 } |
OLD | NEW |