aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiruvadi Rajaraman <trajaraman@mvista.com>2017-11-04 10:39:42 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-21 14:42:58 +0000
commit0c1eec0c6a789e1e9dbfcc66c3fb8c7d1d8b4e99 (patch)
treeaf8420a215e96d30f502c0091ef3171a317481ee
parentcdfb60a7b573c034868ef27d8eb2c667f2a7ad1d (diff)
downloadopenembedded-core-0c1eec0c6a789e1e9dbfcc66c3fb8c7d1d8b4e99.zip
openembedded-core-0c1eec0c6a789e1e9dbfcc66c3fb8c7d1d8b4e99.tar.gz
openembedded-core-0c1eec0c6a789e1e9dbfcc66c3fb8c7d1d8b4e99.tar.bz2
ruby: Secruity fix for CVE-2017-9226
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-9226.patch33
-rw-r--r--meta/recipes-devtools/ruby/ruby_2.2.5.bb1
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/ruby/ruby/CVE-2017-9226.patch b/meta/recipes-devtools/ruby/ruby/CVE-2017-9226.patch
new file mode 100644
index 0000000..fc783e8
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby/CVE-2017-9226.patch
@@ -0,0 +1,33 @@
+commit f015fbdd95f76438cd86366467bb2b39870dd7c6
+Author: K.Kosako <kosako@sofnec.co.jp>
+Date: Fri May 19 15:44:47 2017 +0900
+
+ fix #55 : Byte value expressed in octal must be smaller than 256
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-9226
+Signed-off-by: Thiruvadi Rajaraman <tajaraman@mvista.com>
+
+Index: ruby-2.2.5/regparse.c
+===================================================================
+--- ruby-2.2.5.orig/regparse.c 2017-09-12 16:33:21.977835068 +0530
++++ ruby-2.2.5/regparse.c 2017-09-12 16:34:40.987117744 +0530
+@@ -3222,7 +3222,7 @@
+ PUNFETCH;
+ prev = p;
+ num = scan_unsigned_octal_number(&p, end, 3, enc);
+- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
++ if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
+ if (p == prev) { /* can't read nothing. */
+ num = 0; /* but, it's not error */
+ }
+@@ -3676,7 +3676,7 @@
+ if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
+ prev = p;
+ num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
+- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
++ if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
+ if (p == prev) { /* can't read nothing. */
+ num = 0; /* but, it's not error */
+ }
diff --git a/meta/recipes-devtools/ruby/ruby_2.2.5.bb b/meta/recipes-devtools/ruby/ruby_2.2.5.bb
index bdb2121..b32a705 100644
--- a/meta/recipes-devtools/ruby/ruby_2.2.5.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.2.5.bb
@@ -7,6 +7,7 @@ SRC_URI += "file://prevent-gc.patch \
file://CVE-2016-7798.patch \
file://CVE-2017-9227.patch \
file://CVE-2017-9228.patch \
+ file://CVE-2017-9226.patch \
"
# it's unknown to configure script, but then passed to extconf.rb