From 7f0e0fe4f741dfb80c494e6eb20e43f420257901 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 14 Apr 2017 16:02:08 -0700 Subject: [PATCH] Fix heap overflow if system uses <16kb pages HEAP_ALIGN_LOG was renamed to HEAP_PAGE_ALIGN_LOG between r53467 and r53471. However, configure.in was not updated to match it, so ruby thought the page size was 16kb even if it actually is 4kb. This may also fix heap underflow if using >16kb pages. Problem discovered by OpenBSD's malloc canaries. Originally reported by timo.myyra@wickedbsd.net. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 74f79b35d2..1184ee199c 100644 --- a/configure.in +++ b/configure.in @@ -2243,9 +2243,9 @@ main() { rb_cv_page_size_log="$page_log"; break) done]) if test $rb_cv_page_size_log != no; then - AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log) + AC_DEFINE_UNQUOTED(HEAP_PAGE_ALIGN_LOG, $rb_cv_page_size_log) else - AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12) + AC_DEFINE_UNQUOTED(HEAP_PAGE_ALIGN_LOG, 12) fi ]) -- 2.11.0