Bug 1520962 - Update stackwalking bounds check to avoid aStackEnd. r=dmajor a=lizzard
authorEric Rahm <erahm@mozilla.com>
Fri, 08 Feb 2019 20:22:21 +0000
changeset 513012 c621e6736f7934b85e8d651adaefc7ed37fa3e63
parent 513011 ce8af16e73564df817ad02ccbd65741e2c232490
child 513013 1d59770b712bbfb4b140c1ac8e179601871f8b94
push id10681
push userdluca@mozilla.com
push dateTue, 12 Feb 2019 11:10:25 +0000
treeherdermozilla-beta@8b1e6095f355 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor, lizzard
bugs1520962
milestone66.0
Bug 1520962 - Update stackwalking bounds check to avoid aStackEnd. r=dmajor a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D19210
mozglue/misc/StackWalk.cpp
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -848,17 +848,17 @@ void FramePointerStackWalk(MozWalkStackC
   while (aBp) {
     void** next = (void**)*aBp;
     // aBp may not be a frame pointer on i386 if code was compiled with
     // -fomit-frame-pointer, so do some sanity checks.
     // (aBp should be a frame pointer on ppc(64) but checking anyway may help
     // a little if the stack has been corrupted.)
     // We don't need to check against the begining of the stack because
     // we can assume that aBp > sp
-    if (next <= aBp || next > aStackEnd || (uintptr_t(next) & 3)) {
+    if (next <= aBp || next >= aStackEnd || (uintptr_t(next) & 3)) {
       break;
     }
 #  if (defined(__ppc__) && defined(XP_MACOSX)) || defined(__powerpc64__)
     // ppc mac or powerpc64 linux
     void* pc = *(aBp + 2);
     aBp += 3;
 #  else  // i386 or powerpc32 linux
     void* pc = *(aBp + 1);