1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/fiddle/closure.c (initialize): check mprotect's return value.

If mprotect is failed because of PaX or something, its function call
  will cause SEGV.
  http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130401T210301Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-04-10 18:35:21 +00:00
parent 3f9e0e43c3
commit 2570f838da
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,10 @@
Thu Apr 11 03:33:05 2013 NARUSE, Yui <naruse@ruby-lang.org>
* ext/fiddle/closure.c (initialize): check mprotect's return value.
If mprotect is failed because of PaX or something, its function call
will cause SEGV.
http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130401T210301Z.diff.html.gz
Wed Apr 10 17:39:13 2013 Tanaka Akira <akr@fsij.org>
* ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable

View file

@ -228,7 +228,10 @@ initialize(int rbargc, VALUE argv[], VALUE self)
#else
result = ffi_prep_closure(pcl, cif, callback, (void *)self);
cl->code = (void *)pcl;
mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
i = mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
if (i) {
rb_sys_fail("mprotect");
}
#endif
if (FFI_OK != result)