[PATCH] Protection against stack-based memory corruption errors using SafeStack: compiler-rt runtime support library

Kostya Serebryany kcc at google.com
Tue May 5 16:33:15 PDT 2015


a few random comments, not a thorough review yet.


================
Comment at: lib/safestack/Makefile.mk:1
@@ +1,2 @@
+#===- lib/safestack/Makefile.mk ------------------------------*- Makefile -*--===#
+#
----------------
I don't think we want to support configure/make

================
Comment at: lib/safestack/safestack.cc:56
@@ +55,3 @@
+#if defined(__APPLE__)
+# define safestack_mmap(Args...) mmap(Args)
+# define safestack_munmap(Args...) munmap(Args)
----------------
can this code use more of sanitizer_common?
(here and in the rest of this file)

================
Comment at: lib/safestack/safestack.cc:91
@@ +90,3 @@
+
+  /* On Darwin, we store the unsafe stack pointer in one of the
+   * thread-specific data slots that are reserved for system libraries.
----------------
Why? 
The recent OSX should support TLS well (or not?)

================
Comment at: test/safestack/check-buffer-copy.c:1
@@ +1,2 @@
+// RUN: %clang_safestack %s -o %t
+// RUN: %run %t
----------------
(for all tests) please add a one-line test description

http://reviews.llvm.org/D6096

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list