diff options
author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-05 01:03:32 +0000 |
---|---|---|
committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-05 01:03:32 +0000 |
commit | 0381ae21ec09e278a4a0f6c00ac2a4e2cb54a3de (patch) | |
tree | 1f01eec3a772ca20ea015e45558a64908e599138 /base/linux_util.h | |
parent | d51d08e86464c89e8ab91deb39a448ba24ff2e48 (diff) | |
download | chromium_src-0381ae21ec09e278a4a0f6c00ac2a4e2cb54a3de.zip chromium_src-0381ae21ec09e278a4a0f6c00ac2a4e2cb54a3de.tar.gz chromium_src-0381ae21ec09e278a4a0f6c00ac2a4e2cb54a3de.tar.bz2 |
Setuid sandbox API versioning
We introduce API versioning to the setuid sandbox and issue warnings when
the versions Chrome and the Sandbox expect are different.
1. The Zygote launcher in the browser will export the API version it expects
to the environment.
2. The setuid sandbox will match its own version with the one in the
environment.
3. Afterwards, it will export the API it provides to the environment for the
sandboxed process.
4. The Zygote (the sandboxed process) will in turn check for the API number.
The double check is needed because a version of the browser or of the setuid
sandbox that does check for API could co-exist with a version that does not.
The various utilities that are part of the setuid sandbox are not versioned
because they have callers that are external to Chrome (in ChromeOS).
When environment variables are not found, we assume version 0. Since the API
is for now set to 0, this change will not produce any warning at the moment.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10492006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/linux_util.h')
-rw-r--r-- | base/linux_util.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/base/linux_util.h b/base/linux_util.h index 4f2808b..3ac7279 100644 --- a/base/linux_util.h +++ b/base/linux_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -17,6 +17,11 @@ namespace base { static const char kFindInodeSwitch[] = "--find-inode"; +// This should be kept in sync with sandbox/linux/suid/sandbox.c +static const long kSUIDSandboxApiNumber = 0; +static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ"; +static const char kSandboxEnvironmentApiProvides[] = "SBX_CHROME_API_PRV"; + // This is declared here so the crash reporter can access the memory directly // in compromised context without going through the standard library. BASE_EXPORT extern char g_linux_distro[]; |