Title: [226784] trunk/Source/WTF
Revision
226784
Author
fpi...@apple.com
Date
2018-01-11 09:58:46 -0800 (Thu, 11 Jan 2018)

Log Message

Reserve a fast TLS key for GC TLC
https://bugs.webkit.org/show_bug.cgi?id=181539

Reviewed by Alexey Proskuryakov.
        
Who knew that thread-local caches would be a mitigation for timing attacks. Here's how it
works: if we have TLCs then we can "context switch" them when we "context switch" origins. 
This allows us to put some minimal distance between objects from different origins, which
gives us the ability to allow small overflows when doing certain bounds checks without
creating a useful Spectre information leak.
        
So I think that means we have to implement thread-local caches (also known as thread-local
allocation buffers, but I prefer the TLC terminology).

* wtf/FastTLS.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (226783 => 226784)


--- trunk/Source/WTF/ChangeLog	2018-01-11 16:43:07 UTC (rev 226783)
+++ trunk/Source/WTF/ChangeLog	2018-01-11 17:58:46 UTC (rev 226784)
@@ -1,3 +1,21 @@
+2018-01-11  Filip Pizlo  <fpi...@apple.com>
+
+        Reserve a fast TLS key for GC TLC
+        https://bugs.webkit.org/show_bug.cgi?id=181539
+
+        Reviewed by Alexey Proskuryakov.
+        
+        Who knew that thread-local caches would be a mitigation for timing attacks. Here's how it
+        works: if we have TLCs then we can "context switch" them when we "context switch" origins. 
+        This allows us to put some minimal distance between objects from different origins, which
+        gives us the ability to allow small overflows when doing certain bounds checks without
+        creating a useful Spectre information leak.
+        
+        So I think that means we have to implement thread-local caches (also known as thread-local
+        allocation buffers, but I prefer the TLC terminology).
+
+        * wtf/FastTLS.h:
+
 2018-01-04  Filip Pizlo  <fpi...@apple.com>
 
         CodeBlocks should be in IsoSubspaces

Modified: trunk/Source/WTF/wtf/FastTLS.h (226783 => 226784)


--- trunk/Source/WTF/wtf/FastTLS.h	2018-01-11 16:43:07 UTC (rev 226783)
+++ trunk/Source/WTF/wtf/FastTLS.h	2018-01-11 17:58:46 UTC (rev 226784)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -45,7 +45,8 @@
 
 #define WTF_THREAD_DATA_KEY WTF_FAST_TLS_KEY0
 #define WTF_WASM_CONTEXT_KEY WTF_FAST_TLS_KEY1
-#define WTF_TESTING_KEY WTF_FAST_TLS_KEY2
+#define WTF_TESTING_KEY WTF_WASM_CONTEXT_KEY // So far, this key is only used in places that don't do WebAssembly, so it's OK that they share the same key.
+#define WTF_GC_TLC_KEY WTF_FAST_TLS_KEY2
 
 #if ENABLE(FAST_TLS_JIT)
 inline unsigned fastTLSOffsetForKey(unsigned long slot)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to