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

Unified Diff: sandbox/linux/services/credentials_unittest.cc

Issue 1248673004: Set a new TLS when using CLONE_VM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 5 years, 5 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
Index: sandbox/linux/services/credentials_unittest.cc
diff --git a/sandbox/linux/services/credentials_unittest.cc b/sandbox/linux/services/credentials_unittest.cc
index 6b93c86c3ecbc2104282b50da80e32f3d9ad06d3..3ce4fc3fc61dd224fab55b27662cba6d7b2839df 100644
--- a/sandbox/linux/services/credentials_unittest.cc
+++ b/sandbox/linux/services/credentials_unittest.cc
@@ -6,6 +6,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <pthread.h>
#include <stdio.h>
#include <sys/capability.h>
#include <sys/stat.h>
@@ -237,6 +238,18 @@ SANDBOX_TEST(Credentials, SetCapabilitiesMatchesLibCap2) {
CHECK_EQ(0, cap_compare(expected_cap.get(), actual_cap.get()));
}
+// Disabled on ASAN because of crbug.com/451603.
+SANDBOX_TEST(Credentials, DISABLE_ON_ASAN(DropFileSystemAccessPreservesTLS)) {
+ // Probably missing kernel support.
+ if (!Credentials::MoveToNewUserNS()) return;
+ CHECK(Credentials::DropFileSystemAccess(ProcUtil::OpenProc().get()));
+
+ // In glibc, pthread_getattr_np makes an assertion about the cached PID/TID in
+ // TLS.
+ pthread_attr_t attr;
+ EXPECT_EQ(0, pthread_getattr_np(pthread_self(), &attr));
+}
+
jln (very slow on Chromium) 2015/07/21 23:39:17 Could you add another test that creates a thread t
rickyz (no longer on Chrome) 2015/07/22 04:00:32 Sorry, I wasn't quite sure what kind of test you w
jln (very slow on Chromium) 2015/07/22 17:30:06 Yeah, sorry I meant another "thread" with the vfor
} // namespace.
} // namespace sandbox.
« sandbox/linux/services/credentials.cc ('K') | « sandbox/linux/services/credentials.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698