OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/zygote_host_impl_linux.h" | 5 #include "content/browser/zygote_host_impl_linux.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 } | 519 } |
520 if (HANDLE_EINTR(write(fd, reply_pickle.data(), reply_pickle.size())) != | 520 if (HANDLE_EINTR(write(fd, reply_pickle.data(), reply_pickle.size())) != |
521 static_cast<ssize_t> (reply_pickle.size())) | 521 static_cast<ssize_t> (reply_pickle.size())) |
522 PLOG(ERROR) << "write"; | 522 PLOG(ERROR) << "write"; |
523 return false; | 523 return false; |
524 } | 524 } |
525 | 525 |
526 bool HandleGetSandboxStatus(int fd, | 526 bool HandleGetSandboxStatus(int fd, |
527 const Pickle& pickle, | 527 const Pickle& pickle, |
528 PickleIterator iter) { | 528 PickleIterator iter) { |
529 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_)) != | 529 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != |
530 sizeof(sandbox_flags_))) { | 530 sizeof(sandbox_flags_)) { |
531 PLOG(ERROR) << "write"; | 531 PLOG(ERROR) << "write"; |
532 } | 532 } |
533 | 533 |
534 return false; | 534 return false; |
535 } | 535 } |
536 | 536 |
537 // In the SUID sandbox, we try to use a new PID namespace. Thus the PIDs | 537 // In the SUID sandbox, we try to use a new PID namespace. Thus the PIDs |
538 // fork() returns are not the real PIDs, so we need to map the Real PIDS | 538 // fork() returns are not the real PIDs, so we need to map the Real PIDS |
539 // into the sandbox PID namespace. | 539 // into the sandbox PID namespace. |
540 typedef base::hash_map<base::ProcessHandle, base::ProcessHandle> ProcessMap; | 540 typedef base::hash_map<base::ProcessHandle, base::ProcessHandle> ProcessMap; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 VLOG(1) << "Enabling experimental Seccomp sandbox."; | 873 VLOG(1) << "Enabling experimental Seccomp sandbox."; |
874 sandbox_flags |= ZygoteHostImpl::kSandboxSeccomp; | 874 sandbox_flags |= ZygoteHostImpl::kSandboxSeccomp; |
875 } | 875 } |
876 } | 876 } |
877 #endif // SECCOMP_SANDBOX | 877 #endif // SECCOMP_SANDBOX |
878 | 878 |
879 Zygote zygote(sandbox_flags, forkdelegate); | 879 Zygote zygote(sandbox_flags, forkdelegate); |
880 // This function call can return multiple times, once per fork(). | 880 // This function call can return multiple times, once per fork(). |
881 return zygote.ProcessRequests(); | 881 return zygote.ProcessRequests(); |
882 } | 882 } |
OLD | NEW |