changeset 12227:d005924be65c

8160411: SIGSEGV in frame::safe_for_sender on incomplete DeoptimizationBlob frame Summary: add range check for sender_sp Reviewed-by: aph, dcubed
author dlong
date Fri, 21 Oct 2016 17:51:33 -0700
parents 560423724f98
children 820e8a4db30d
files src/cpu/aarch64/vm/frame_aarch64.cpp src/cpu/x86/vm/frame_x86.cpp
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/frame_aarch64.cpp	Fri Oct 21 13:07:32 2016 -0700
+++ b/src/cpu/aarch64/vm/frame_aarch64.cpp	Fri Oct 21 17:51:33 2016 -0700
@@ -142,6 +142,10 @@
       }
 
       sender_sp = _unextended_sp + _cb->frame_size();
+      // Is sender_sp safe?
+      if ((address)sender_sp >= thread->stack_base()) {
+        return false;
+      }
       sender_unextended_sp = sender_sp;
       sender_pc = (address) *(sender_sp-1);
       // Note: frame::sender_sp_offset is only valid for compiled frame
--- a/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 21 13:07:32 2016 -0700
+++ b/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 21 17:51:33 2016 -0700
@@ -140,6 +140,10 @@
       }
 
       sender_sp = _unextended_sp + _cb->frame_size();
+      // Is sender_sp safe?
+      if ((address)sender_sp >= thread->stack_base()) {
+        return false;
+      }
       sender_unextended_sp = sender_sp;
       // On Intel the return_address is always the word on the stack
       sender_pc = (address) *(sender_sp-1);