diff options
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/ruby/ruby/CVE-2017-9229.patch | 36 | ||||
| -rw-r--r-- | meta/recipes-devtools/ruby/ruby_2.2.5.bb | 1 |
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 0000000000..75bdfada57 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/CVE-2017-9229.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | commit b690371bbf97794b4a1d3f295d4fb9a8b05d402d | ||
| 2 | Author: K.Kosako <kosako@sofnec.co.jp> | ||
| 3 | Date: Wed May 24 10:27:04 2017 +0900 | ||
| 4 | |||
| 5 | fix #59 : access to invalid address by reg->dmax value | ||
| 6 | |||
| 7 | Upstream-Status: Backport | ||
| 8 | |||
| 9 | CVE: CVE-2017-9229 | ||
| 10 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
| 11 | |||
| 12 | Index: ruby-2.2.5/regexec.c | ||
| 13 | =================================================================== | ||
| 14 | --- ruby-2.2.5.orig/regexec.c 2017-09-13 12:17:08.429254209 +0530 | ||
| 15 | +++ ruby-2.2.5/regexec.c 2017-09-13 12:24:03.365312311 +0530 | ||
| 16 | @@ -3763,6 +3763,12 @@ | ||
| 17 | } | ||
| 18 | else { | ||
| 19 | if (reg->dmax != ONIG_INFINITE_DISTANCE) { | ||
| 20 | + if (p - str < reg->dmax) { | ||
| 21 | + *low = (UChar* )str; | ||
| 22 | + if (low_prev) | ||
| 23 | + *low_prev = onigenc_get_prev_char_head(reg->enc, str, *low, end); | ||
| 24 | + } | ||
| 25 | + else { | ||
| 26 | *low = p - reg->dmax; | ||
| 27 | if (*low > s) { | ||
| 28 | *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s, | ||
| 29 | @@ -3776,6 +3782,7 @@ | ||
| 30 | *low_prev = onigenc_get_prev_char_head(reg->enc, | ||
| 31 | (pprev ? pprev : str), *low, end); | ||
| 32 | } | ||
| 33 | + } | ||
| 34 | } | ||
| 35 | } | ||
| 36 | /* 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 b32a705a5b..4b90ee6522 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 \ | |||
| 8 | file://CVE-2017-9227.patch \ | 8 | file://CVE-2017-9227.patch \ |
| 9 | file://CVE-2017-9228.patch \ | 9 | file://CVE-2017-9228.patch \ |
| 10 | file://CVE-2017-9226.patch \ | 10 | file://CVE-2017-9226.patch \ |
| 11 | file://CVE-2017-9229.patch \ | ||
| 11 | " | 12 | " |
| 12 | 13 | ||
| 13 | # it's unknown to configure script, but then passed to extconf.rb | 14 | # it's unknown to configure script, but then passed to extconf.rb |
