summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2022-04-18 09:04:08 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-19 14:02:13 +0100
commit91e14d3a8e6e67267047473f5c449f266b44f354 (patch)
tree9b71398acd7db67d151bc643d60fc74419c13200 /meta
parent8f48f1014f90c3ceacd8be367c209f941a3622ba (diff)
downloadpoky-91e14d3a8e6e67267047473f5c449f266b44f354.tar.gz
lua: fix CVE-2022-28805
singlevar in lparser.c in Lua through 5.4.4 lacks a certain luaK_exp2anyregup call, leading to a heap-based buffer over-read that might affect a system that compiles untrusted Lua code. https://nvd.nist.gov/vuln/detail/CVE-2022-28805 (From OE-Core rev: d2ba3b8850d461bc7b773240cdf15b22b31a3f9e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/lua/lua/CVE-2022-28805.patch26
-rw-r--r--meta/recipes-devtools/lua/lua_5.4.4.bb1
2 files changed, 27 insertions, 0 deletions
diff --git a/meta/recipes-devtools/lua/lua/CVE-2022-28805.patch b/meta/recipes-devtools/lua/lua/CVE-2022-28805.patch
new file mode 100644
index 0000000000..3680c715a7
--- /dev/null
+++ b/meta/recipes-devtools/lua/lua/CVE-2022-28805.patch
@@ -0,0 +1,26 @@
1From 1f3c6f4534c6411313361697d98d1145a1f030fa Mon Sep 17 00:00:00 2001
2From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
3Date: Tue, 15 Feb 2022 12:28:46 -0300
4Subject: [PATCH] Bug: Lua can generate wrong code when _ENV is <const>
5
6CVE: CVE-2022-28805
7
8Upstream-Status: Backport [https://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa]
9
10Signed-off-by: Steve Sakoman <steve@sakoman.com>
11---
12 src/lparser.c | 1 +
13 1 files changed, 1 insertions(+)
14
15diff --git a/src/lparser.c b/src/lparser.c
16index 3abe3d751..a5cd55257 100644
17--- a/src/lparser.c
18+++ b/src/lparser.c
19@@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) {
20 expdesc key;
21 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
22 lua_assert(var->k != VVOID); /* this one must exist */
23+ luaK_exp2anyregup(fs, var); /* but could be a constant */
24 codestring(&key, varname); /* key is variable name */
25 luaK_indexed(fs, var, &key); /* env[varname] */
26 }
diff --git a/meta/recipes-devtools/lua/lua_5.4.4.bb b/meta/recipes-devtools/lua/lua_5.4.4.bb
index f50328ecfd..d704841378 100644
--- a/meta/recipes-devtools/lua/lua_5.4.4.bb
+++ b/meta/recipes-devtools/lua/lua_5.4.4.bb
@@ -6,6 +6,7 @@ HOMEPAGE = "http://www.lua.org/"
6 6
7SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \ 7SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
8 file://lua.pc.in \ 8 file://lua.pc.in \
9 file://CVE-2022-28805.patch \
9 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest file://run-ptest ', '', d)} \ 10 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest file://run-ptest ', '', d)} \
10 " 11 "
11 12