diff options
| -rw-r--r-- | meta-oe/recipes-multimedia/libass/libass/CVE-2020-24994.patch | 48 | ||||
| -rw-r--r-- | meta-oe/recipes-multimedia/libass/libass_0.14.0.bb | 4 |
2 files changed, 51 insertions, 1 deletions
diff --git a/meta-oe/recipes-multimedia/libass/libass/CVE-2020-24994.patch b/meta-oe/recipes-multimedia/libass/libass/CVE-2020-24994.patch new file mode 100644 index 0000000000..b0fc9297d8 --- /dev/null +++ b/meta-oe/recipes-multimedia/libass/libass/CVE-2020-24994.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | From 99eaa60314c4e28c2f0c295e165daf22c5601cc3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Oleg Oshmyan <chortos@inbox.lv> | ||
| 3 | Date: Thu, 4 Jan 2018 02:42:09 +0200 | ||
| 4 | Subject: [PATCH] parse_tags: don't recurse for nested \t() | ||
| 5 | |||
| 6 | This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4892 | ||
| 7 | (stack overflow on deeply nested \t()). | ||
| 8 | |||
| 9 | This is possible because parentheses do not nest and the first ')' | ||
| 10 | terminates the whole tag. Thus something like \t(\t(\t(\t(\t() can be | ||
| 11 | read in a simple loop with no recursion required. Recursion is also | ||
| 12 | not required if the ')' is missing entirely and the outermost \t(... | ||
| 13 | never ends. | ||
| 14 | |||
| 15 | See https://github.com/libass/libass/pull/296 for more backstory. | ||
| 16 | |||
| 17 | CVE: CVE-2020-24994 | ||
| 18 | Upstream-Status: Backport [https://github.com/libass/libass/commit/6835731c2fe4164a0c50bc91d12c43b2a2b4e] | ||
| 19 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 20 | --- | ||
| 21 | libass/ass_parse.c | 14 ++++++++++++-- | ||
| 22 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/libass/ass_parse.c b/libass/ass_parse.c | ||
| 25 | index c83634a..991d1b6 100644 | ||
| 26 | --- a/libass/ass_parse.c | ||
| 27 | +++ b/libass/ass_parse.c | ||
| 28 | @@ -650,8 +650,18 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, char *end, double pwr) | ||
| 29 | k = pow(((double) (t - t1)) / delta_t, accel); | ||
| 30 | } | ||
| 31 | p = args[cnt].start; | ||
| 32 | - while (p < args[cnt].end) | ||
| 33 | - p = parse_tag(render_priv, p, args[cnt].end, k); // maybe k*pwr ? no, specs forbid nested \t's | ||
| 34 | + if (args[cnt].end < end) { | ||
| 35 | + while (p < args[cnt].end) | ||
| 36 | + p = parse_tag(render_priv, p, args[cnt].end, k); // maybe k*pwr ? no, specs forbid nested \t's | ||
| 37 | + } else { | ||
| 38 | + assert(q == end); | ||
| 39 | + // No other tags can possibly follow this \t tag, | ||
| 40 | + // so we don't need to restore pwr after parsing \t. | ||
| 41 | + // The recursive call is now essentially a tail call, | ||
| 42 | + // so optimize it away. | ||
| 43 | + pwr = k; | ||
| 44 | + q = p; | ||
| 45 | + } | ||
| 46 | } else if (complex_tag("clip")) { | ||
| 47 | if (nargs == 4) { | ||
| 48 | int x0, y0, x1, y1; | ||
diff --git a/meta-oe/recipes-multimedia/libass/libass_0.14.0.bb b/meta-oe/recipes-multimedia/libass/libass_0.14.0.bb index 0e62307363..f0579ba25f 100644 --- a/meta-oe/recipes-multimedia/libass/libass_0.14.0.bb +++ b/meta-oe/recipes-multimedia/libass/libass_0.14.0.bb | |||
| @@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a42532a0684420bdb15556c3cdd49a75" | |||
| 7 | 7 | ||
| 8 | DEPENDS = "enca fontconfig freetype libpng fribidi" | 8 | DEPENDS = "enca fontconfig freetype libpng fribidi" |
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/libass/libass.git;branch=master;protocol=https" | 10 | SRC_URI = "git://github.com/libass/libass.git;branch=master;protocol=https \ |
| 11 | file://CVE-2020-24994.patch \ | ||
| 12 | " | ||
| 11 | SRCREV = "73284b676b12b47e17af2ef1b430527299e10c17" | 13 | SRCREV = "73284b676b12b47e17af2ef1b430527299e10c17" |
| 12 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |
| 13 | 15 | ||
