diff options
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | ext/fiddle/closure.c | 5 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Sun Apr 14 23:43:06 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 + Sun Apr 14 23:19:55 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c index fdb2233b22..d064f11991 100644 --- a/ext/fiddle/closure.c +++ b/ext/fiddle/closure.c @@ -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) @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-04-14" -#define RUBY_PATCHLEVEL 125 +#define RUBY_PATCHLEVEL 126 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 4 |
