Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: sandbox/linux/seccomp/exit.cc

Issue 371047: Allow the seccomp sandbox to be enabled, even if the suid sandbox has... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp/clone.cc ('k') | sandbox/linux/seccomp/ioctl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 #include "debug.h" 1 #include "debug.h"
2 #include "sandbox_impl.h" 2 #include "sandbox_impl.h"
3 3
4 namespace playground { 4 namespace playground {
5 5
6 int Sandbox::sandbox_exit(int status) { 6 int Sandbox::sandbox_exit(int status) {
7 Debug::syscall(__NR_exit, "Executing handler"); 7 Debug::syscall(__NR_exit, "Executing handler");
8 struct { 8 struct {
9 int sysnum; 9 int sysnum;
10 long long cookie; 10 long long cookie;
11 } __attribute__((packed)) request; 11 } __attribute__((packed)) request;
12 request.sysnum = __NR_exit; 12 request.sysnum = __NR_exit;
13 request.cookie = cookie(); 13 request.cookie = cookie();
14 14
15 SysCalls sys; 15 SysCalls sys;
16 if (write(sys, processFdPub(), &request, sizeof(request)) != 16 if (write(sys, processFdPub(), &request, sizeof(request)) !=
17 sizeof(request)) { 17 sizeof(request)) {
18 die("Failed to forward exit() request [sandbox]"); 18 die("Failed to forward exit() request [sandbox]");
19 } 19 }
20 for (;;) { 20 for (;;) {
21 sys._exit(status); 21 sys._exit(status);
22 } 22 }
23 } 23 }
24 24
25 bool Sandbox::process_exit(int parentProc, int sandboxFd, int threadFdPub, 25 bool Sandbox::process_exit(int parentMapsFd, int sandboxFd, int threadFdPub,
26 int threadFd, SecureMem::Args* mem) { 26 int threadFd, SecureMem::Args* mem) {
27 SecureMem::lockSystemCall(parentProc, mem); 27 SecureMem::lockSystemCall(parentMapsFd, mem);
28 SecureMem::sendSystemCall(threadFdPub, true, parentProc, mem, __NR_exit, 0); 28 SecureMem::sendSystemCall(threadFdPub, true, parentMapsFd, mem,
29 __NR_exit, 0);
29 return true; 30 return true;
30 } 31 }
31 32
32 } // namespace 33 } // namespace
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp/clone.cc ('k') | sandbox/linux/seccomp/ioctl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698