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

Unified Diff: sandbox/linux/seccomp/ioctl.cc

Issue 3225010: Pull seccomp-sandbox in via DEPS rather than using an in-tree copy... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/seccomp/gettid.cc ('k') | sandbox/linux/seccomp/ipc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/ioctl.cc
===================================================================
--- sandbox/linux/seccomp/ioctl.cc (revision 57969)
+++ sandbox/linux/seccomp/ioctl.cc (working copy)
@@ -1,61 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "debug.h"
-#include "sandbox_impl.h"
-
-namespace playground {
-
-long Sandbox::sandbox_ioctl(int d, int req, void *arg) {
- long long tm;
- Debug::syscall(&tm, __NR_ioctl, "Executing handler");
- struct {
- int sysnum;
- long long cookie;
- IOCtl ioctl_req;
- } __attribute__((packed)) request;
- request.sysnum = __NR_ioctl;
- request.cookie = cookie();
- request.ioctl_req.d = d;
- request.ioctl_req.req = req;
- request.ioctl_req.arg = arg;
-
- long rc;
- SysCalls sys;
- if (write(sys, processFdPub(), &request, sizeof(request)) !=
- sizeof(request) ||
- read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
- die("Failed to forward ioctl() request [sandbox]");
- }
- Debug::elapsed(tm, __NR_ioctl);
- return rc;
-}
-
-bool Sandbox::process_ioctl(int parentMapsFd, int sandboxFd, int threadFdPub,
- int threadFd, SecureMem::Args* mem) {
- // Read request
- IOCtl ioctl_req;
- SysCalls sys;
- if (read(sys, sandboxFd, &ioctl_req, sizeof(ioctl_req)) !=sizeof(ioctl_req)){
- die("Failed to read parameters for ioctl() [process]");
- }
- int rc = -EINVAL;
- switch (ioctl_req.req) {
- case TCGETS:
- case TIOCGWINSZ:
- SecureMem::sendSystemCall(threadFdPub, false, -1, mem, __NR_ioctl,
- ioctl_req.d, ioctl_req.req, ioctl_req.arg);
- return true;
- default:
- if (Debug::isEnabled()) {
- char buf[80];
- sprintf(buf, "Unsupported ioctl: 0x%04X\n", ioctl_req.req);
- Debug::message(buf);
- }
- SecureMem::abandonSystemCall(threadFd, rc);
- return false;
- }
-}
-
-} // namespace
« no previous file with comments | « sandbox/linux/seccomp/gettid.cc ('k') | sandbox/linux/seccomp/ipc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698