aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiruvadi Rajaraman <trajaraman@mvista.com>2017-11-04 10:41:02 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-21 14:42:58 +0000
commita636bf8cb5063f349b2af6594b131af6852b3076 (patch)
tree0dabfe315e3daa5dfcf0b3846101e42b71668ca8
parent0c1eec0c6a789e1e9dbfcc66c3fb8c7d1d8b4e99 (diff)
downloadopenembedded-core-a636bf8cb5063f349b2af6594b131af6852b3076.zip
openembedded-core-a636bf8cb5063f349b2af6594b131af6852b3076.tar.gz
openembedded-core-a636bf8cb5063f349b2af6594b131af6852b3076.tar.bz2
ruby: Security fix for CVE-2017-9229
affects ruby < 2.4.1 Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> Signed-off-by: Armin Kuster <akuster@mvista.com>
-rw-r--r--meta/recipes-devtools/ruby/ruby/CVE-2017-9229.patch36
-rw-r--r--meta/recipes-devtools/ruby/ruby_2.2.5.bb1
2 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/ruby/ruby/CVE-2017-9229.patch b/meta/recipes-devtools/ruby/ruby/CVE-2017-9229.patch
new file mode 100644
index 0000000..75bdfad
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby/CVE-2017-9229.patch
@@ -0,0 +1,36 @@
+commit b690371bbf97794b4a1d3f295d4fb9a8b05d402d
+Author: K.Kosako <kosako@sofnec.co.jp>
+Date: Wed May 24 10:27:04 2017 +0900
+
+ fix #59 : access to invalid address by reg->dmax value
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-9229
+Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
+
+Index: ruby-2.2.5/regexec.c
+===================================================================
+--- ruby-2.2.5.orig/regexec.c 2017-09-13 12:17:08.429254209 +0530
++++ ruby-2.2.5/regexec.c 2017-09-13 12:24:03.365312311 +0530
+@@ -3763,6 +3763,12 @@
+ }
+ else {
+ if (reg->dmax != ONIG_INFINITE_DISTANCE) {
++ if (p - str < reg->dmax) {
++ *low = (UChar* )str;
++ if (low_prev)
++ *low_prev = onigenc_get_prev_char_head(reg->enc, str, *low, end);
++ }
++ else {
+ *low = p - reg->dmax;
+ if (*low > s) {
+ *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
+@@ -3776,6 +3782,7 @@
+ *low_prev = onigenc_get_prev_char_head(reg->enc,
+ (pprev ? pprev : str), *low, end);
+ }
++ }
+ }
+ }
+ /* no needs to adjust *high, *high is used as range check only */
diff --git a/meta/recipes-devtools/ruby/ruby_2.2.5.bb b/meta/recipes-devtools/ruby/ruby_2.2.5.bb
index b32a705..4b90ee6 100644
--- a/meta/recipes-devtools/ruby/ruby_2.2.5.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.2.5.bb
@@ -8,6 +8,7 @@ SRC_URI += "file://prevent-gc.patch \
file://CVE-2017-9227.patch \
file://CVE-2017-9228.patch \
file://CVE-2017-9226.patch \
+ file://CVE-2017-9229.patch \
"
# it's unknown to configure script, but then passed to extconf.rb