summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-01 07:26:39 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-01 07:26:39 +0000
commit232f31ca12a94eb9f51182955285a4474f876af7 (patch)
tree7643d2e3ccdf0323633e23f45aab5707ac871dff /vm_args.c
parent8a098051c58446db8be3dcaea3447ce83e16df99 (diff)
on-smash canary detection
In addition to detect dead canary, we try to detect the very moment when we smash the stack top. Requested by k0kubun: https://twitter.com/k0kubun/status/1085180749899194368 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index 0b99fdece4..932c3b75b5 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -525,6 +525,7 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
VALUE * const orig_sp = ec->cfp->sp;
unsigned int i;
+ vm_check_canary(ec, orig_sp);
/*
* Extend SP for GC.
*
@@ -782,6 +783,7 @@ vm_caller_setup_arg_splat(rb_control_frame_t *cfp, struct rb_calling_info *calli
VALUE *argv = cfp->sp - argc;
VALUE ary = argv[argc-1];
+ vm_check_canary(GET_EC(), cfp->sp);
cfp->sp--;
if (!NIL_P(ary)) {