diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-11 09:48:58 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-11 09:48:58 +0000 |
commit | c2bfb4e93c674347b7eb09a30856e3d75f74cf4d (patch) | |
tree | b898add4e9f9ab117aebcad189d47e79984c2f16 /internal.h | |
parent | ecda2d23d593eea81a4daf97ec0d74945fa96baf (diff) | |
download | ruby-c2bfb4e93c674347b7eb09a30856e3d75f74cf4d.tar.gz |
add new instruction attribute called leaf
An instruction is leaf if it has no rb_funcall inside. In order to
check this property, we introduce stack canary which is a random
number collected at runtime. Stack top is always filled with this
number and checked for stack smashing operations, when VM_CHECK_MODE.
[GH-1947]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal.h b/internal.h index 8cbe16aaff..bfbd90bc5e 100644 --- a/internal.h +++ b/internal.h @@ -1901,6 +1901,9 @@ VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef); void rb_autoload_str(VALUE mod, ID id, VALUE file); void rb_deprecate_constant(VALUE mod, const char *name); NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE)); +rb_gvar_getter_t *rb_gvar_getter_function_of(const struct rb_global_entry *); +rb_gvar_setter_t *rb_gvar_setter_function_of(const struct rb_global_entry *); +bool rb_gvar_is_traced(const struct rb_global_entry *); /* vm_insnhelper.h */ rb_serial_t rb_next_class_serial(void); @@ -1946,6 +1949,7 @@ VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv, /* vm_insnhelper.c */ VALUE rb_equal_opt(VALUE obj1, VALUE obj2); VALUE rb_eql_opt(VALUE obj1, VALUE obj2); +void Init_vm_stack_canary(void); /* vm_method.c */ void Init_eval_method(void); @@ -2099,6 +2103,9 @@ VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VAL VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0); #endif +/* random.c */ +int fill_random_bytes(void *, size_t, int); + RUBY_SYMBOL_EXPORT_END #define RUBY_DTRACE_CREATE_HOOK(name, arg) \ |