summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-multimedia/libass/libass/CVE-2020-24994.patch48
-rw-r--r--meta-oe/recipes-multimedia/libass/libass_0.14.0.bb4
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 @@
1From 99eaa60314c4e28c2f0c295e165daf22c5601cc3 Mon Sep 17 00:00:00 2001
2From: Oleg Oshmyan <chortos@inbox.lv>
3Date: Thu, 4 Jan 2018 02:42:09 +0200
4Subject: [PATCH] parse_tags: don't recurse for nested \t()
5
6This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4892
7(stack overflow on deeply nested \t()).
8
9This is possible because parentheses do not nest and the first ')'
10terminates the whole tag. Thus something like \t(\t(\t(\t(\t() can be
11read in a simple loop with no recursion required. Recursion is also
12not required if the ')' is missing entirely and the outermost \t(...
13never ends.
14
15See https://github.com/libass/libass/pull/296 for more backstory.
16
17CVE: CVE-2020-24994
18Upstream-Status: Backport [https://github.com/libass/libass/commit/6835731c2fe4164a0c50bc91d12c43b2a2b4e]
19Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
20---
21 libass/ass_parse.c | 14 ++++++++++++--
22 1 file changed, 12 insertions(+), 2 deletions(-)
23
24diff --git a/libass/ass_parse.c b/libass/ass_parse.c
25index 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
8DEPENDS = "enca fontconfig freetype libpng fribidi" 8DEPENDS = "enca fontconfig freetype libpng fribidi"
9 9
10SRC_URI = "git://github.com/libass/libass.git;branch=master;protocol=https" 10SRC_URI = "git://github.com/libass/libass.git;branch=master;protocol=https \
11 file://CVE-2020-24994.patch \
12 "
11SRCREV = "73284b676b12b47e17af2ef1b430527299e10c17" 13SRCREV = "73284b676b12b47e17af2ef1b430527299e10c17"
12S = "${WORKDIR}/git" 14S = "${WORKDIR}/git"
13 15