blob: ecf7291311f6103930d61c8af11db9af8c2745a6 [file] [log] [blame]
[email protected]cc8f1462009-06-12 17:36:551// Copyright (c) 2009 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]a0f200ea2009-08-06 18:44:065#include <dlfcn.h>
[email protected]da11a4be2009-11-04 04:07:336#include <unistd.h>
[email protected]83a0cbe2009-11-04 04:22:477#include <sys/epoll.h>
8#include <sys/types.h>
9#include <sys/socket.h>
10#include <sys/signal.h>
11#include <sys/prctl.h>
12#include <sys/wait.h>
[email protected]cc8f1462009-06-12 17:36:5513
[email protected]789f70c72009-07-24 13:55:4314#include "base/basictypes.h"
[email protected]cc8f1462009-06-12 17:36:5515#include "base/command_line.h"
16#include "base/eintr_wrapper.h"
17#include "base/global_descriptors_posix.h"
[email protected]c9e45da02009-08-05 17:35:0818#include "base/path_service.h"
[email protected]cc8f1462009-06-12 17:36:5519#include "base/pickle.h"
[email protected]4378a822009-07-08 01:15:1420#include "base/rand_util.h"
[email protected]1831acf2009-10-05 16:38:4121#include "base/scoped_ptr.h"
[email protected]80a086c52009-08-04 17:52:0422#include "base/sys_info.h"
[email protected]cc8f1462009-06-12 17:36:5523#include "base/unix_domain_socket_posix.h"
24
25#include "chrome/browser/zygote_host_linux.h"
26#include "chrome/common/chrome_descriptors.h"
[email protected]4730db92009-07-22 00:40:4827#include "chrome/common/chrome_switches.h"
[email protected]cc8f1462009-06-12 17:36:5528#include "chrome/common/main_function_params.h"
29#include "chrome/common/process_watcher.h"
[email protected]73fa63992009-07-20 20:30:0730#include "chrome/common/sandbox_methods_linux.h"
[email protected]cc8f1462009-06-12 17:36:5531
[email protected]c9e45da02009-08-05 17:35:0832#include "media/base/media.h"
33
[email protected]abe3ad92009-06-15 18:15:0834#include "skia/ext/SkFontHost_fontconfig_control.h"
35
[email protected]83a0cbe2009-11-04 04:22:4736#if defined(CHROMIUM_SELINUX)
37#include <selinux/selinux.h>
38#include <selinux/context.h>
39#endif
40
[email protected]1831acf2009-10-05 16:38:4141#include "unicode/timezone.h"
42
[email protected]cc8f1462009-06-12 17:36:5543// http://code.google.com/p/chromium/wiki/LinuxZygote
44
[email protected]73fa63992009-07-20 20:30:0745static const int kMagicSandboxIPCDescriptor = 5;
46
[email protected]cc8f1462009-06-12 17:36:5547// This is the object which implements the zygote. The ZygoteMain function,
48// which is called from ChromeMain, at the the bottom and simple constructs one
49// of these objects and runs it.
50class Zygote {
51 public:
52 bool ProcessRequests() {
53 // A SOCK_SEQPACKET socket is installed in fd 3. We get commands from the
54 // browser on it.
[email protected]83a0cbe2009-11-04 04:22:4755 // A SOCK_DGRAM is installed in fd 4. This is the sandbox IPC channel.
[email protected]abe3ad92009-06-15 18:15:0856 // See http://code.google.com/p/chromium/wiki/LinuxSandboxIPC
[email protected]cc8f1462009-06-12 17:36:5557
58 // We need to accept SIGCHLD, even though our handler is a no-op because
59 // otherwise we cannot wait on children. (According to POSIX 2001.)
60 struct sigaction action;
61 memset(&action, 0, sizeof(action));
62 action.sa_handler = SIGCHLDHandler;
63 CHECK(sigaction(SIGCHLD, &action, NULL) == 0);
64
65 for (;;) {
[email protected]83a0cbe2009-11-04 04:22:4766 if (HandleRequestFromBrowser(3))
[email protected]cc8f1462009-06-12 17:36:5567 return true;
68 }
69 }
70
71 private:
72 // See comment below, where sigaction is called.
73 static void SIGCHLDHandler(int signal) { }
74
75 // ---------------------------------------------------------------------------
76 // Requests from the browser...
77
78 // Read and process a request from the browser. Returns true if we are in a
79 // new process and thus need to unwind back into ChromeMain.
80 bool HandleRequestFromBrowser(int fd) {
81 std::vector<int> fds;
[email protected]abe3ad92009-06-15 18:15:0882 static const unsigned kMaxMessageLength = 1024;
[email protected]cc8f1462009-06-12 17:36:5583 char buf[kMaxMessageLength];
84 const ssize_t len = base::RecvMsg(fd, buf, sizeof(buf), &fds);
85 if (len == -1) {
86 LOG(WARNING) << "Error reading message from browser: " << errno;
87 return false;
88 }
89
90 if (len == 0) {
91 // EOF from the browser. We should die.
92 _exit(0);
93 return false;
94 }
95
96 Pickle pickle(buf, len);
97 void* iter = NULL;
98
99 int kind;
[email protected]57113ea2009-06-18 02:23:16100 if (pickle.ReadInt(&iter, &kind)) {
101 switch (kind) {
102 case ZygoteHost::kCmdFork:
103 return HandleForkRequest(fd, pickle, iter, fds);
104 case ZygoteHost::kCmdReap:
105 if (!fds.empty())
106 break;
107 return HandleReapRequest(fd, pickle, iter);
108 case ZygoteHost::kCmdDidProcessCrash:
109 if (!fds.empty())
110 break;
111 return HandleDidProcessCrash(fd, pickle, iter);
112 default:
113 NOTREACHED();
114 break;
115 }
[email protected]cc8f1462009-06-12 17:36:55116 }
117
[email protected]cc8f1462009-06-12 17:36:55118 LOG(WARNING) << "Error parsing message from browser";
119 for (std::vector<int>::const_iterator
120 i = fds.begin(); i != fds.end(); ++i)
121 close(*i);
122 return false;
123 }
124
[email protected]83a0cbe2009-11-04 04:22:47125 bool HandleReapRequest(int fd, Pickle& pickle, void* iter) {
126 pid_t child;
[email protected]cc8f1462009-06-12 17:36:55127
128 if (!pickle.ReadInt(&iter, &child)) {
129 LOG(WARNING) << "Error parsing reap request from browser";
130 return false;
131 }
132
[email protected]83a0cbe2009-11-04 04:22:47133 ProcessWatcher::EnsureProcessTerminated(child);
[email protected]cc8f1462009-06-12 17:36:55134
135 return false;
136 }
137
[email protected]83a0cbe2009-11-04 04:22:47138 bool HandleDidProcessCrash(int fd, Pickle& pickle, void* iter) {
[email protected]57113ea2009-06-18 02:23:16139 base::ProcessHandle child;
140
141 if (!pickle.ReadInt(&iter, &child)) {
142 LOG(WARNING) << "Error parsing DidProcessCrash request from browser";
143 return false;
144 }
145
146 bool child_exited;
[email protected]83a0cbe2009-11-04 04:22:47147 bool did_crash = base::DidProcessCrash(&child_exited, child);
[email protected]57113ea2009-06-18 02:23:16148
149 Pickle write_pickle;
150 write_pickle.WriteBool(did_crash);
151 write_pickle.WriteBool(child_exited);
152 HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size()));
153
154 return false;
155 }
156
[email protected]cc8f1462009-06-12 17:36:55157 // Handle a 'fork' request from the browser: this means that the browser
158 // wishes to start a new renderer.
[email protected]83a0cbe2009-11-04 04:22:47159 bool HandleForkRequest(int fd, Pickle& pickle, void* iter,
[email protected]cc8f1462009-06-12 17:36:55160 std::vector<int>& fds) {
161 std::vector<std::string> args;
162 int argc, numfds;
163 base::GlobalDescriptors::Mapping mapping;
[email protected]83a0cbe2009-11-04 04:22:47164 pid_t child;
[email protected]cc8f1462009-06-12 17:36:55165
166 if (!pickle.ReadInt(&iter, &argc))
167 goto error;
168
169 for (int i = 0; i < argc; ++i) {
170 std::string arg;
171 if (!pickle.ReadString(&iter, &arg))
172 goto error;
173 args.push_back(arg);
174 }
175
176 if (!pickle.ReadInt(&iter, &numfds))
177 goto error;
178 if (numfds != static_cast<int>(fds.size()))
179 goto error;
180
181 for (int i = 0; i < numfds; ++i) {
182 base::GlobalDescriptors::Key key;
183 if (!pickle.ReadUInt32(&iter, &key))
184 goto error;
185 mapping.push_back(std::make_pair(key, fds[i]));
186 }
187
[email protected]abe3ad92009-06-15 18:15:08188 mapping.push_back(std::make_pair(
[email protected]83a0cbe2009-11-04 04:22:47189 static_cast<uint32_t>(kSandboxIPCChannel), 5));
[email protected]abe3ad92009-06-15 18:15:08190
[email protected]cc8f1462009-06-12 17:36:55191 child = fork();
192
193 if (!child) {
[email protected]83a0cbe2009-11-04 04:22:47194 close(3); // our socket from the browser is in fd 3
[email protected]cc8f1462009-06-12 17:36:55195 Singleton<base::GlobalDescriptors>()->Reset(mapping);
[email protected]0189bbd2009-10-12 22:50:39196
197 // Reset the process-wide command line to our new command line.
[email protected]cc8f1462009-06-12 17:36:55198 CommandLine::Reset();
[email protected]0189bbd2009-10-12 22:50:39199 CommandLine::Init(0, NULL);
200 CommandLine::ForCurrentProcess()->InitFromArgv(args);
[email protected]7f113f32009-09-10 18:02:17201 CommandLine::SetProcTitle();
[email protected]cc8f1462009-06-12 17:36:55202 return true;
203 }
204
[email protected]cc8f1462009-06-12 17:36:55205 for (std::vector<int>::const_iterator
206 i = fds.begin(); i != fds.end(); ++i)
207 close(*i);
[email protected]83a0cbe2009-11-04 04:22:47208
209 HANDLE_EINTR(write(fd, &child, sizeof(child)));
210 return false;
211
212 error:
213 LOG(WARNING) << "Error parsing fork request from browser";
214 for (std::vector<int>::const_iterator
215 i = fds.begin(); i != fds.end(); ++i)
216 close(*i);
[email protected]cc8f1462009-06-12 17:36:55217 return false;
218 }
[email protected]cc8f1462009-06-12 17:36:55219};
220
[email protected]ad6d2c42009-09-15 20:13:38221// With SELinux we can carve out a precise sandbox, so we don't have to play
222// with intercepting libc calls.
223#if !defined(CHROMIUM_SELINUX)
224
[email protected]a0f200ea2009-08-06 18:44:06225static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output,
226 char* timezone_out,
227 size_t timezone_out_len) {
[email protected]73fa63992009-07-20 20:30:07228 Pickle request;
229 request.WriteInt(LinuxSandbox::METHOD_LOCALTIME);
230 request.WriteString(
231 std::string(reinterpret_cast<char*>(&input), sizeof(input)));
232
233 uint8_t reply_buf[512];
234 const ssize_t r = base::SendRecvMsg(
235 kMagicSandboxIPCDescriptor, reply_buf, sizeof(reply_buf), NULL, request);
236 if (r == -1) {
237 memset(output, 0, sizeof(struct tm));
238 return;
239 }
240
241 Pickle reply(reinterpret_cast<char*>(reply_buf), r);
242 void* iter = NULL;
[email protected]9debcda52009-07-22 20:06:51243 std::string result, timezone;
[email protected]73fa63992009-07-20 20:30:07244 if (!reply.ReadString(&iter, &result) ||
[email protected]9debcda52009-07-22 20:06:51245 !reply.ReadString(&iter, &timezone) ||
[email protected]73fa63992009-07-20 20:30:07246 result.size() != sizeof(struct tm)) {
247 memset(output, 0, sizeof(struct tm));
248 return;
249 }
250
251 memcpy(output, result.data(), sizeof(struct tm));
[email protected]9debcda52009-07-22 20:06:51252 if (timezone_out_len) {
253 const size_t copy_len = std::min(timezone_out_len - 1, timezone.size());
254 memcpy(timezone_out, timezone.data(), copy_len);
255 timezone_out[copy_len] = 0;
256 output->tm_zone = timezone_out;
257 } else {
258 output->tm_zone = NULL;
259 }
[email protected]73fa63992009-07-20 20:30:07260}
261
[email protected]a0f200ea2009-08-06 18:44:06262static bool g_am_zygote_or_renderer = false;
263
264// Sandbox interception of libc calls.
265//
266// Because we are running in a sandbox certain libc calls will fail (localtime
267// being the motivating example - it needs to read /etc/localtime). We need to
268// intercept these calls and proxy them to the browser. However, these calls
269// may come from us or from our libraries. In some cases we can't just change
270// our code.
271//
272// It's for these cases that we have the following setup:
273//
274// We define global functions for those functions which we wish to override.
275// Since we will be first in the dynamic resolution order, the dynamic linker
276// will point callers to our versions of these functions. However, we have the
277// same binary for both the browser and the renderers, which means that our
278// overrides will apply in the browser too.
279//
280// The global |g_am_zygote_or_renderer| is true iff we are in a zygote or
281// renderer process. It's set in ZygoteMain and inherited by the renderers when
282// they fork. (This means that it'll be incorrect for global constructor
283// functions and before ZygoteMain is called - beware).
284//
285// Our replacement functions can check this global and either proxy
286// the call to the browser over the sandbox IPC
287// (http://code.google.com/p/chromium/wiki/LinuxSandboxIPC) or they can use
288// dlsym with RTLD_NEXT to resolve the symbol, ignoring any symbols in the
289// current module.
290//
291// Other avenues:
292//
293// Our first attempt involved some assembly to patch the GOT of the current
294// module. This worked, but was platform specific and doesn't catch the case
295// where a library makes a call rather than current module.
296//
297// We also considered patching the function in place, but this would again by
298// platform specific and the above technique seems to work well enough.
299
[email protected]a5d7bb82009-09-08 22:30:58300static void WarnOnceAboutBrokenDlsym();
301
[email protected]73fa63992009-07-20 20:30:07302struct tm* localtime(const time_t* timep) {
[email protected]a0f200ea2009-08-06 18:44:06303 if (g_am_zygote_or_renderer) {
304 static struct tm time_struct;
305 static char timezone_string[64];
306 ProxyLocaltimeCallToBrowser(*timep, &time_struct, timezone_string,
307 sizeof(timezone_string));
308 return &time_struct;
309 } else {
310 typedef struct tm* (*LocaltimeFunction)(const time_t* timep);
311 static LocaltimeFunction libc_localtime;
[email protected]a5d7bb82009-09-08 22:30:58312 static bool have_libc_localtime = false;
313 if (!have_libc_localtime) {
[email protected]a0f200ea2009-08-06 18:44:06314 libc_localtime = (LocaltimeFunction) dlsym(RTLD_NEXT, "localtime");
[email protected]a5d7bb82009-09-08 22:30:58315 have_libc_localtime = true;
316 }
317
318 if (!libc_localtime) {
319 // http://code.google.com/p/chromium/issues/detail?id=16800
320 //
321 // Nvidia's libGL.so overrides dlsym for an unknown reason and replaces
322 // it with a version which doesn't work. In this case we'll get a NULL
323 // result. There's not a lot we can do at this point, so we just bodge it!
324 WarnOnceAboutBrokenDlsym();
325
326 return gmtime(timep);
327 }
[email protected]a0f200ea2009-08-06 18:44:06328
329 return libc_localtime(timep);
330 }
[email protected]73fa63992009-07-20 20:30:07331}
332
333struct tm* localtime_r(const time_t* timep, struct tm* result) {
[email protected]a0f200ea2009-08-06 18:44:06334 if (g_am_zygote_or_renderer) {
335 ProxyLocaltimeCallToBrowser(*timep, result, NULL, 0);
336 return result;
337 } else {
338 typedef struct tm* (*LocaltimeRFunction)(const time_t* timep,
339 struct tm* result);
340 static LocaltimeRFunction libc_localtime_r;
[email protected]a5d7bb82009-09-08 22:30:58341 static bool have_libc_localtime_r = false;
342 if (!have_libc_localtime_r) {
[email protected]a0f200ea2009-08-06 18:44:06343 libc_localtime_r = (LocaltimeRFunction) dlsym(RTLD_NEXT, "localtime_r");
[email protected]a5d7bb82009-09-08 22:30:58344 have_libc_localtime_r = true;
345 }
346
347 if (!libc_localtime_r) {
348 // See |localtime|, above.
349 WarnOnceAboutBrokenDlsym();
350
351 return gmtime_r(timep, result);
352 }
[email protected]a0f200ea2009-08-06 18:44:06353
354 return libc_localtime_r(timep, result);
355 }
[email protected]73fa63992009-07-20 20:30:07356}
357
[email protected]a5d7bb82009-09-08 22:30:58358// See the comments at the callsite in |localtime| about this function.
359static void WarnOnceAboutBrokenDlsym() {
360 static bool have_shown_warning = false;
361 if (!have_shown_warning) {
362 LOG(ERROR) << "Your system is broken: dlsym doesn't work! This has been "
363 "reported to be caused by Nvidia's libGL. You should expect "
364 "time related functions to misbehave. "
365 "http://code.google.com/p/chromium/issues/detail?id=16800";
366 have_shown_warning = true;
367 }
368}
[email protected]ad6d2c42009-09-15 20:13:38369#endif // !CHROMIUM_SELINUX
[email protected]a5d7bb82009-09-08 22:30:58370
[email protected]ad6d2c42009-09-15 20:13:38371// This function triggers the static and lazy construction of objects that need
372// to be created before imposing the sandbox.
373static void PreSandboxInit() {
[email protected]4378a822009-07-08 01:15:14374 base::RandUint64();
375
[email protected]80a086c52009-08-04 17:52:04376 base::SysInfo::MaxSharedMemorySize();
377
[email protected]e6acd672009-07-24 21:51:33378 // To make wcstombs/mbstowcs work in a renderer, setlocale() has to be
379 // called before the sandbox is triggered. It's possible to avoid calling
380 // setlocale() by pulling out the conversion between FilePath and
381 // WebCore String out of the renderer and using string16 in place of
382 // FilePath for IPC.
383 const char* locale = setlocale(LC_ALL, "");
384 LOG_IF(WARNING, locale == NULL) << "setlocale failed.";
385
[email protected]1831acf2009-10-05 16:38:41386 // ICU DateFormat class (used in base/time_format.cc) needs to get the
387 // Olson timezone ID by accessing the zoneinfo files on disk. After
388 // TimeZone::createDefault is called once here, the timezone ID is
389 // cached and there's no more need to access the file system.
390 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
391
[email protected]c9e45da02009-08-05 17:35:08392 FilePath module_path;
393 if (PathService::Get(base::DIR_MODULE, &module_path))
394 media::InitializeMediaLibrary(module_path);
[email protected]ad6d2c42009-09-15 20:13:38395}
396
397#if !defined(CHROMIUM_SELINUX)
398static bool EnterSandbox() {
399 const char* const sandbox_fd_string = getenv("SBX_D");
400 if (sandbox_fd_string) {
401 // The SUID sandbox sets this environment variable to a file descriptor
402 // over which we can signal that we have completed our startup and can be
403 // chrooted.
404
[email protected]ad6d2c42009-09-15 20:13:38405 char* endptr;
406 const long fd_long = strtol(sandbox_fd_string, &endptr, 10);
407 if (!*sandbox_fd_string || *endptr || fd_long < 0 || fd_long > INT_MAX)
408 return false;
409 const int fd = fd_long;
410
411 PreSandboxInit();
[email protected]c9e45da02009-08-05 17:35:08412
[email protected]abe3ad92009-06-15 18:15:08413 static const char kChrootMe = 'C';
414 static const char kChrootMeSuccess = 'O';
415
[email protected]0e1611122009-07-10 18:17:32416 if (HANDLE_EINTR(write(fd, &kChrootMe, 1)) != 1) {
417 LOG(ERROR) << "Failed to write to chroot pipe: " << errno;
[email protected]abe3ad92009-06-15 18:15:08418 return false;
[email protected]0e1611122009-07-10 18:17:32419 }
[email protected]abe3ad92009-06-15 18:15:08420
[email protected]87ed6952009-07-16 02:52:15421 // We need to reap the chroot helper process in any event:
422 wait(NULL);
423
[email protected]abe3ad92009-06-15 18:15:08424 char reply;
[email protected]87f8ce62009-07-10 19:14:31425 if (HANDLE_EINTR(read(fd, &reply, 1)) != 1) {
[email protected]0e1611122009-07-10 18:17:32426 LOG(ERROR) << "Failed to read from chroot pipe: " << errno;
[email protected]abe3ad92009-06-15 18:15:08427 return false;
[email protected]0e1611122009-07-10 18:17:32428 }
[email protected]87f8ce62009-07-10 19:14:31429
[email protected]0e1611122009-07-10 18:17:32430 if (reply != kChrootMeSuccess) {
431 LOG(ERROR) << "Error code reply from chroot helper";
[email protected]abe3ad92009-06-15 18:15:08432 return false;
[email protected]0e1611122009-07-10 18:17:32433 }
[email protected]abe3ad92009-06-15 18:15:08434
[email protected]abe3ad92009-06-15 18:15:08435 SkiaFontConfigUseIPCImplementation(kMagicSandboxIPCDescriptor);
436
[email protected]415493be2009-07-10 17:50:24437 // Previously, we required that the binary be non-readable. This causes the
438 // kernel to mark the process as non-dumpable at startup. The thinking was
439 // that, although we were putting the renderers into a PID namespace (with
440 // the SUID sandbox), they would nonetheless be in the /same/ PID
441 // namespace. So they could ptrace each other unless they were non-dumpable.
442 //
443 // If the binary was readable, then there would be a window between process
444 // startup and the point where we set the non-dumpable flag in which a
445 // compromised renderer could ptrace attach.
446 //
447 // However, now that we have a zygote model, only the (trusted) zygote
448 // exists at this point and we can set the non-dumpable flag which is
449 // inherited by all our renderer children.
[email protected]4730db92009-07-22 00:40:48450 //
451 // Note: a non-dumpable process can't be debugged. To debug sandbox-related
452 // issues, one can specify --allow-sandbox-debugging to let the process be
453 // dumpable.
454 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
455 if (!command_line.HasSwitch(switches::kAllowSandboxDebugging)) {
456 prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
457 if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) {
458 LOG(ERROR) << "Failed to set non-dumpable flag";
459 return false;
460 }
[email protected]0e1611122009-07-10 18:17:32461 }
[email protected]abe3ad92009-06-15 18:15:08462 } else {
463 SkiaFontConfigUseDirectImplementation();
464 }
465
466 return true;
467}
[email protected]ad6d2c42009-09-15 20:13:38468#else // CHROMIUM_SELINUX
469
470static bool EnterSandbox() {
471 PreSandboxInit();
472 SkiaFontConfigUseIPCImplementation(kMagicSandboxIPCDescriptor);
473
474 security_context_t security_context;
475 if (getcon(&security_context)) {
476 LOG(ERROR) << "Cannot get SELinux context";
477 return false;
478 }
479
480 context_t context = context_new(security_context);
481 context_type_set(context, "chromium_renderer_t");
482 const int r = setcon(context_str(context));
483 context_free(context);
484 freecon(security_context);
485
486 if (r) {
487 LOG(ERROR) << "dynamic transition to type 'chromium_renderer_t' failed. "
488 "(this binary has been built with SELinux support, but maybe "
489 "the policies haven't been loaded into the kernel?";
490 return false;
491 }
492
493 return true;
494}
495
496#endif // CHROMIUM_SELINUX
[email protected]abe3ad92009-06-15 18:15:08497
[email protected]cc8f1462009-06-12 17:36:55498bool ZygoteMain(const MainFunctionParams& params) {
[email protected]ad6d2c42009-09-15 20:13:38499#if !defined(CHROMIUM_SELINUX)
[email protected]a0f200ea2009-08-06 18:44:06500 g_am_zygote_or_renderer = true;
[email protected]ad6d2c42009-09-15 20:13:38501#endif
[email protected]a0f200ea2009-08-06 18:44:06502
[email protected]ad6d2c42009-09-15 20:13:38503 if (!EnterSandbox()) {
[email protected]abe3ad92009-06-15 18:15:08504 LOG(FATAL) << "Failed to enter sandbox. Fail safe abort. (errno: "
505 << errno << ")";
506 return false;
507 }
508
[email protected]cc8f1462009-06-12 17:36:55509 Zygote zygote;
510 return zygote.ProcessRequests();
511}