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

Unified Diff: sandbox/linux/suid/sandbox.c

Issue 197213015: [Linux] Use PR_SET_NO_NEW_PRIVS by default in base/process/launch.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address jln's comments Created 6 years, 9 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 | « content/browser/zygote_host/zygote_host_impl_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/suid/sandbox.c
diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c
index f6e6c495d9d3557857268c555b32bd550074dfe7..3793a4c26b781be4307aaf5de599bb66afded167 100644
--- a/sandbox/linux/suid/sandbox.c
+++ b/sandbox/linux/suid/sandbox.c
@@ -303,13 +303,14 @@ static bool MoveToNewNamespaces() {
// something went wrong, hence we bail with an error message rather then
// provide less security.
if (errno != EINVAL) {
+ fprintf(stderr, "Failed to move to new namespace:");
if (kCloneExtraFlags[i] & CLONE_NEWPID) {
- fprintf(stderr, " PID namespaces supported");
+ fprintf(stderr, " PID namespaces supported,");
}
if (kCloneExtraFlags[i] & CLONE_NEWNET) {
- fprintf(stderr, " Network namespace supported");
+ fprintf(stderr, " Network namespace supported,");
}
- fprintf(stderr, "but failed: errno = %s\n", strerror(clone_errno));
+ fprintf(stderr, " but failed: errno = %s\n", strerror(clone_errno));
return false;
}
}
@@ -486,6 +487,11 @@ int main(int argc, char **argv) {
return 1;
}
+ if (geteuid() != 0) {
+ fprintf(stderr, "The setuid sandbox is not running as root. Did the parent "
jln (very slow on Chromium) 2014/04/02 19:06:55 Nit: s/the parent/a parent/ ?
Robert Sesek 2014/04/02 19:57:05 Done.
+ "process prctl(PR_SET_NO_NEW_PRIVS, ...)?\n");
jln (very slow on Chromium) 2014/04/02 19:06:55 Could you add something such as: "Are you using a
Robert Sesek 2014/04/02 19:57:05 Done.
+ }
+
if (!MoveToNewNamespaces())
return 1;
if (!SpawnChrootHelper())
« no previous file with comments | « content/browser/zygote_host/zygote_host_impl_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698