[PATCH] [ASan] Improved stack overflow detection for PowerPC64

Evgeniy Stepanov eugenis at google.com
Fri Nov 14 06:52:36 PST 2014


stack-overflow test actually catches this? Nice.

================
Comment at: lib/asan/asan_posix.cc:57
@@ +56,3 @@
+  if (!IsStackAccess && IsAccessibleMemoryRange(pc, 4)) {
+    unsigned inst = *(unsigned *)pc;
+    unsigned ra = (inst >> 16) & 0x1F;
----------------
Please make it u32 instead of unsigned.

================
Comment at: lib/asan/asan_posix.cc:61
@@ +60,3 @@
+    unsigned xo = (inst >> 1) & 0x3FF;
+    // Check for store-with-update to r1.
+    if (ra == 1 &&
----------------
It may be helpful to list or somehow characterize instructions that match this condition (I mean, there is obviously more than 1 opcode listed here).

I assume these "xo" checks limit it to instructions operating on SP register?

http://reviews.llvm.org/D6253






More information about the llvm-commits mailing list