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

Unified Diff: third_party/WebKit/Source/wtf/Assertions.h

Issue 1841363003: Replace RELEASE_ASSERT_WITH_SECURITY_IMPLICATION with SECURITY_CHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/wtf/Assertions.h
diff --git a/third_party/WebKit/Source/wtf/Assertions.h b/third_party/WebKit/Source/wtf/Assertions.h
index 3962562ffd6f36121f90cd2ff3a97a00b36e33f2..a6917d62b85b8b8074dd6ce5b85d61a7c405da8a 100644
--- a/third_party/WebKit/Source/wtf/Assertions.h
+++ b/third_party/WebKit/Source/wtf/Assertions.h
@@ -215,10 +215,9 @@ private:
#endif
-// ASSERT_WITH_SECURITY_IMPLICATION / RELEASE_ASSERT_WITH_SECURITY_IMPLICATION
-// They are deprecated. ASSERT_WITH_SECURITY_IMPLICATION should be replaced
-// with SECURITY_DCHECK, and RELEASE_ASSERT_WITH_SECURITY_IMPLICATION should be
-// replaced with RELEASE_ASSERT.
+// ASSERT_WITH_SECURITY_IMPLICATION
+// It is deprecated. ASSERT_WITH_SECURITY_IMPLICATION should be replaced
+// with SECURITY_DCHECK.
haraken 2016/03/31 00:54:58 SECURITY_DCHECK => SECURITY_CHECK ?
dcheng 2016/03/31 01:09:40 I'm not sure how expensive this will be, all the t
tkent 2016/03/31 05:26:12 SECURITY_DCHECK is correct here. ASSERT -> DCHECK
#ifdef ADDRESS_SANITIZER
#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) \
@@ -227,13 +226,8 @@ private:
CRASH()) : \
(void)0)
-#define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT_WITH_SECURITY_IMPLICATION(assertion)
-
#else
-
#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT(assertion)
-#define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) RELEASE_ASSERT(assertion)
-
#endif
// Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure
@@ -244,16 +238,20 @@ private:
#define ENABLE_SECURITY_ASSERT 0
#endif
-// SECURITY_DCHECK
+// SECURITY_DCHECK and SECURITY_CHECK
// Use in places where failure of the assertion indicates a possible security
// vulnerability. Classes of these vulnerabilities include bad casts, out of
// bounds accesses, use-after-frees, etc. Please be sure to file bugs for these
// failures using the security template:
-// http://code.google.com/p/chromium/issues/entry?template=Security%20Bug
+// https://bugs.chromium.org/p/chromium/issues/entry?template=Security%20Bug
#if ENABLE_SECURITY_ASSERT
#define SECURITY_DCHECK(condition) LOG_IF(FATAL, !(condition)) << "Security check failed: " #condition ". "
+// TODO(tkent): Should we make SECURITY_CHECK different from SECURITY_DCHECK?
+// A SECURITY_CHECK failure is actually not vulnerable.
haraken 2016/03/31 00:54:58 Maybe failures that are not vulnerable should use
dcheng 2016/03/31 01:09:40 (I think) the security team uses this as a signal
inferno 2016/03/31 04:04:18 Yes correct, otherwise we won't be able to disting
Oliver Chang 2016/03/31 06:13:39 Why do we need to distinguish between CHECK and SE
+#define SECURITY_CHECK(condition) SECURITY_DCHECK(condition)
#else
#define SECURITY_DCHECK(condition) ((void)0)
+#define SECURITY_CHECK(condition) CHECK(condition)
#endif
// WTF_LOG
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.cpp ('k') | third_party/WebKit/Source/wtf/PartitionAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698