[PATCH] Protection against stack-based memory corruption errors using SafeStack: compiler-rt runtime support library
Peter Collingbourne
peter at pcc.me.uk
Tue May 19 14:19:21 PDT 2015
================
Comment at: lib/safestack/safestack.cc:20
@@ +19,3 @@
+#include <limits.h>
+#include <sys/mman.h>
+#include <sys/user.h>
----------------
kcc wrote:
> Please check if you still need so many headers. Remove anything you don't need.
Done
================
Comment at: lib/safestack/safestack.cc:64
@@ +63,3 @@
+ void *addr = MmapOrDie(size + guard, "unsafe_stack_alloc");
+ if (addr == MAP_FAILED)
+ return nullptr;
----------------
kcc wrote:
> MmapOrDie dies if it fails. You should not need the check
Removed
================
Comment at: lib/safestack/safestack.cc:83
@@ +82,3 @@
+ if (unsafe_stack_start) {
+ // We need the munmap system call without any LD_PRELOAD overrides
+ // (such overrides might crash if they use the unsafe stack themselves)
----------------
kcc wrote:
> do you still need this comment?
Removed
================
Comment at: test/safestack/check-pthread-cleanup.c:10
@@ +9,3 @@
+
+#define BUFFER_SIZE (1 << 15)
+
----------------
kcc wrote:
> kBufferSize
Done
http://reviews.llvm.org/D6096
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list