diff options
Diffstat (limited to 'poky/meta/recipes-devtools/ruby')
4 files changed, 103 insertions, 74 deletions
diff --git a/poky/meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch b/poky/meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch new file mode 100644 index 000000000..4cc1fa027 --- /dev/null +++ b/poky/meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch @@ -0,0 +1,101 @@ +From 3a8189530312e81d6c005c396565f985a47f3383 Mon Sep 17 00:00:00 2001 +From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Date: Fri, 8 Feb 2019 07:22:55 +0000 +Subject: [PATCH] configure.ac: check finite,isinf,isnan as macros first +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ruby-core:91487] [Bug #15595] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e + +--- +Upstream-Status: Backport [https://github.com/ruby/ruby/commit/74f94b3e6ebf15b76f3b357e754095412b006e94] +(modified so as to apply cleanly here) +Signed-off-by: André Draszik <andre.draszik@jci.com> +--- + aclocal.m4 | 1 + + configure.ac | 13 ++++--------- + tool/m4/ruby_replace_funcs.m4 | 13 +++++++++++++ + 3 files changed, 18 insertions(+), 9 deletions(-) + create mode 100644 tool/m4/ruby_replace_funcs.m4 + +diff --git a/aclocal.m4 b/aclocal.m4 +index 18ba297b05..2a907b3467 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -13,3 +13,4 @@ + + m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) + m4_include([acinclude.m4]) ++m4_include([tool/m4/ruby_replace_funcs.m4]) +diff --git a/configure.ac b/configure.ac +index 8a7cee55b8..b97c5b3cc9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1189,9 +1189,6 @@ main() + ac_cv_func_fsync=yes + ac_cv_func_seekdir=yes + ac_cv_func_telldir=yes +- ac_cv_func_isinf=yes +- ac_cv_func_isnan=yes +- ac_cv_func_finite=yes + ac_cv_func_lchown=yes + ac_cv_func_link=yes + ac_cv_func_readlink=yes +@@ -1239,9 +1236,6 @@ main() + [netbsd*], [ LIBS="-lm $LIBS" + ], + [dragonfly*], [ LIBS="-lm $LIBS" +- # isinf() and isnan() are macros on DragonFly. +- ac_cv_func_isinf=yes +- ac_cv_func_isnan=yes + ], + [aix*],[ LIBS="-lm $LIBS" + ac_cv_func_round=no +@@ -2213,11 +2207,8 @@ AC_REPLACE_FUNCS(dup2) + AC_REPLACE_FUNCS(erf) + AC_REPLACE_FUNCS(explicit_bzero) + AC_REPLACE_FUNCS(ffs) +-AC_REPLACE_FUNCS(finite) + AC_REPLACE_FUNCS(flock) + AC_REPLACE_FUNCS(hypot) +-AC_REPLACE_FUNCS(isinf) +-AC_REPLACE_FUNCS(isnan) + AC_REPLACE_FUNCS(lgamma_r) + AC_REPLACE_FUNCS(memmove) + AC_REPLACE_FUNCS(nextafter) +@@ -2229,6 +2220,10 @@ AC_REPLACE_FUNCS(strlcpy) + AC_REPLACE_FUNCS(strstr) + AC_REPLACE_FUNCS(tgamma) + ++RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>]) ++RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>]) ++RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>]) ++ + # for missing/setproctitle.c + AS_CASE(["$target_os"], + [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)], +diff --git a/tool/m4/ruby_replace_funcs.m4 b/tool/m4/ruby_replace_funcs.m4 +new file mode 100644 +index 0000000000..d0612e29a0 +--- /dev/null ++++ b/tool/m4/ruby_replace_funcs.m4 +@@ -0,0 +1,13 @@ ++# -*- Autoconf -*- ++dnl RUBY_REPLACE_FUNC [func] [included] ++AC_DEFUN([RUBY_REPLACE_FUNC], [dnl ++ AC_CHECK_DECL([$1],dnl ++ [AC_DEFINE(AS_TR_CPP(HAVE_[$1]))],dnl ++ [AC_REPLACE_FUNCS($1)],dnl ++ [$2])dnl ++]) ++ ++dnl RUBY_REPLACE_FUNCS [funcs] [included] ++AC_DEFUN([RUBY_REPLACE_FUNCS] [dnl ++ m4_map_args_w([$1], [RUBY_REPLACE_FUNC(], [), [$2]])dnl ++]) +-- +2.23.0.rc1 + diff --git a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch deleted file mode 100644 index 89437bba7..000000000 --- a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b4bf968ad52afe14e60a2dc8a95d3555c543353a Mon Sep 17 00:00:00 2001 -From: "K.Kosako" <kosako@sofnec.co.jp> -Date: Thu, 18 May 2017 17:05:27 +0900 -Subject: [PATCH] fix #55 : check too big code point value for single byte - value in next_state_val() - ---- - regparse.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- end of original header - -CVE: CVE-2017-9226 - -Add check for octal number bigger than 255. - -Upstream-Status: Pending -Signed-off-by: Joe Slater <joe.slater@windriver.com> - - ---- ruby-2.4.1.orig/regparse.c -+++ ruby-2.4.1/regparse.c -@@ -4450,6 +4450,9 @@ next_state_val(CClassNode* cc, CClassNod - switch (*state) { - case CCS_VALUE: - if (*type == CCV_SB) { -+ if (*from > 0xff) -+ return ONIGERR_INVALID_CODE_POINT_VALUE; -+ - BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*from)); - if (IS_NOT_NULL(asc_cc)) - BITSET_SET_BIT(asc_cc->bs, (int )(*from)); diff --git a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch deleted file mode 100644 index d8bfba486..000000000 --- a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 3b63d12038c8d8fc278e81c942fa9bec7c704c8b Mon Sep 17 00:00:00 2001 -From: "K.Kosako" <kosako@sofnec.co.jp> -Date: Wed, 24 May 2017 13:43:25 +0900 -Subject: [PATCH] fix #60 : invalid state(CCS_VALUE) in parse_char_class() - ---- - regparse.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- end of original header - -CVE: CVE-2017-9228 - -Upstream-Status: Inappropriate [not author] -Signed-off-by: Joe Slater <joe.slater@windriver.com> - -diff --git a/regparse.c b/regparse.c -index 69875fa..1988747 100644 ---- a/regparse.c -+++ b/regparse.c -@@ -4081,7 +4081,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type, - } - } - -- *state = CCS_VALUE; -+ if (*state != CCS_START) -+ *state = CCS_VALUE; -+ - *type = CCV_CLASS; - return 0; - } --- -1.7.9.5 - diff --git a/poky/meta/recipes-devtools/ruby/ruby_2.5.5.bb b/poky/meta/recipes-devtools/ruby/ruby_2.5.5.bb index 8ad59a765..223b0371e 100644 --- a/poky/meta/recipes-devtools/ruby/ruby_2.5.5.bb +++ b/poky/meta/recipes-devtools/ruby/ruby_2.5.5.bb @@ -1,25 +1,19 @@ require ruby.inc SRC_URI += " \ - file://ruby-CVE-2017-9226.patch \ - file://ruby-CVE-2017-9228.patch \ + file://0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \ file://run-ptest \ " SRC_URI[md5sum] = "7e156fb526b8f4bb1b30a3dd8a7ce400" SRC_URI[sha256sum] = "28a945fdf340e6ba04fc890b98648342e3cccfd6d223a48f3810572f11b2514c" -# it's unknown to configure script, but then passed to extconf.rb -# maybe it's not really needed as we're hardcoding the result with -# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch -UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo" - PACKAGECONFIG ??= "" PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind" PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp" -PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo," +PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6," EXTRA_AUTORECONF += "--exclude=aclocal" |