summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-devtools/lua
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2020-09-18 21:36:00 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-09-18 21:38:11 +0300
commitd688a01edf38bfee9e20fd4765d304c529dd3db3 (patch)
tree474bcaeea91f90853d5dfb221abc661eb49787b2 /meta-openembedded/meta-oe/recipes-devtools/lua
parentcc58928593c3952679181b6bf8e4113080ffa867 (diff)
downloadopenbmc-d688a01edf38bfee9e20fd4765d304c529dd3db3.tar.xz
meta-openembedded: subtree update:ae39f2e711..bccd3277e4
Alejandro Enedino Hernandez Samaniego (2): emacs: Create a new recipe for emacs weechat: Upgrade to 2.9 Andreas Müller (3): Initial add source-code-pro-fonts 2.030_1.050 gedit: add source-code-pro-fonts to RRECOMMENDS geany: add source-code-pro-fonts to RRECOMMENDS Andrej Valek (1): squid: upgrade 4.12 -> 4.13 Armin Kuster (3): log4cplus: pkg moved to core kea: pkg moved to core dhcpcd: pkg moved to core Arthur She (1): xmlrpc-c: fix Makefile macro error Arturo Buzarra (1): byacc: add nativesdk support Bartosz Golaszewski (1): libgpiod: update v1.4.3 -> v1.4.4 Bjarne Michelsen (1): asio: extend recipe to add native support Diego Rondini (4): libeigen: update SRC_URI to download from gitlab gvfs: adjust fuse packageconfig to fuse3 libeigen: update SRC_URI to use gitlab git hplip: use libexecdir Fabio Berton (2): libqmi: Update 1.26.0 -> 1.26.4 modemmanager: Update 1.12.12 -> 1.14.2 Gianfranco Costamagna (3): dlt-daemon: superseed upstream pr #238 patch with pr #245 due to unexpected behaviour brotli: update to 1.0.9 brotli: set upstream-status for the patch backported from upstream Haiqing Bai (1): rsyslog: fix wrong option of PACKAGECONFIG[valgrind] Hongxu Jia (1): python3-texttable: add recipe Jack Mitchell (1): meta-networking: dhcpcd: backport ALIGN compile error fix Jens Rehsack (1): bearssl: fix missing install Jose Dapena Paz (1): xmlsec1: do not use system libraries for non nss Jugurtha BELKALEM (1): recipe/ettercap : new ettercap recipe Khem Raj (67): valijson: Move it to networking-layer under BBFILES_DYNAMIC linuxptp: Fix cross build kernel-selftest: Tests in 5.8 depend on libhugetlbfs.h wireguard-module: Exlude from world builds Revert "iwd: Module load dir should be relative to root_dir" vboxguestdrivers: Fix build with kernel 5.8 kernel-selftest: Disable vm tests for mips/arm vulkan-cts: Update to 1.2.3.2 nss: Avoid converting enum to void* nss: Disable Werror across all recipe types nss: Upgrade to 3.56 mini-iconv: Remove wvstreams: Update SRC_URI to a fetchable location wvdial: Update SRC_URI to an accessible location packagegroup-meta-oe: Overhaul so it can build meta-oe-image mime-support: Use update-alternatives canutils: Use update-alternatives libusbgx: Use update-alternatives ttf-liberation-sans-narrow: Do not install normal liberation fonts mutter: Add a comment to remove pipewire-0.2 dependency with 3.36 sblim-sfcb: Fix target postinst hexedit: Define update alternatives lmbench: Use update alternatives for stream uml-utilities: Use update alternatives for tunctl imagemagick: Create symlinks for magick-script sharutils: Use update alternatives for uudecode/uuencode layer.conf: fixes icon-theme signature changes layer.conf: Fix for signature change for allarch icon themes properties-cpp: Add recipe packagegroup-meta-filesystems: Update to add new recipes packagegroup-meta-webserver: Update to include new recipes monkey: Remove /var/run monkey: Correct the install path in init services packagegroup-meta-oe: Exclude from world builds networkmanager: Depend on dhcpcd packagegroup-meta-networking: Add new packages bearssl: fix GNU_HASH link error autossh: Depend on ssh instead of hardcoding openssh quagga,pimd: Use update-alternatives for pimd netkit-rpc: Use update alternatives for rpcinfo ssmtp: Use update alternatives for conflicts with esmtp netkit-rwho: Use update-alternatives for tftp netkit-ftp: Use update-alternatives for ftp netkit-rwho: Convert to ontarget postinst schroedinger: Update SRC_URI packagegroup-meta-multimedia: Add new recipes mycroft: rdep on procps imapfilter: Fix linker flags toybox: Add packageconfigs for iconv and getconf tmux: Add -p option to mkdir packagegroup-meta-networking: Remove dhcpcd and kea packagegroup-meta-oe: Remove log4cplus packagegroup-meta-multimedia: Remove projucer on musl packagegroup-meta-perl: Update to represent latest recipes po4a: Switch to github for SRC_URI as alioth one seems to be gone libdata-hexdump-perl: Use update alternatives for hexdump meta-perl-image: Add packagegroup-meta-perl-extended meta-perl-ptest-image: Depend on ptest DISTRO_FEATURE iwd: Upgrade to 1.9 packagegroup-meta-python: Add new packages meta-python-image,meta-python-ptest-image: Use python3 packagegroups android-tools: Support libselinux to build with musl which now has gettid packagegroup-meta-oe.bb: Add cukinia to test packagegroups packagegroup-meta-oe: Add source-code-pro-fonts mongodb: Pass OBJCOPY to scons so it does not use it from host mongodb: Fix libunwind build with -fno-common mongodb: Fix i386 builds for non-glibc systems Leon Anavi (134): python3-pywbem: Upgrade 0.17.4 -> 1.0.2 python3-pydicti: Add recipe python3-yamlloader: Add recipe python3-tabulate: Add recipe python3-asciitree: Add recipe python3-custom-inherit: Add recipe python3-nocasedict: Add recipe python3-nocaselist: Add recipe python3-click-repl: Add recipe python3-click-spinner: Add recipe python3-pywbemtools: Add recipe python3-diskcache: Upgrade 4.1.0 -> 5.0.1 python3-langtable: Upgrade 0.0.51 -> 0.0.52 python3-pint: Upgrade 0.14 -> 0.15 python3-networkx: Upgrade 2.4 -> 2.5 python3-attrs: Upgrade 19.3.0 -> 20.1.0 python3-pychromecast: Upgrade 7.2.0 -> 7.2.1 python3-dominate: Upgrade 2.5.1 -> 2.5.2 python3-pymisp: Upgrade 2.4.128 -> 2.4.130 python3-inflection: Upgrade 0.5.0 -> 0.5.1 python3-typing-extensions: Upgrade 3.7.4.2 -> 3.7.4.3 python3-pandas: Upgrade 1.1.0 -> 1.1.1 python3-msm: Upgrade 0.8.7 -> 0.8.8 lshw: Upgrade 2.18 -> 2.19 mercurial: Upgrade 5.4 -> 5.5 doxygen: Upgrade 1.8.17 -> 1.8.20 python3-bitarray: Upgrade 1.5.2 -> 1.5.3 python3-cryptography-vectors: Upgrade 2.9.2 -> 3.0 python3-openpyxl: Upgrade 3.0.4 -> 3.0.5 python3-cmd2: Upgrade 1.3.3 -> 1.3.4 python3-sentry-sdk: Upgrade 0.16.5 -> 0.17.0 python3-flask: Consolidate in a single file python3-flask: Upgrade 1.1.1 -> 1.1.2 python3-diskcache: Upgrade 5.0.1 -> 5.0.2 python3-cmd2: Upgrade 1.3.4 -> 1.3.5 python3-flask-wtf: Consolidate in a single file python3-flask-wtf: Upgrade 0.14.2 -> 0.14.3 python3-flask-socketio: Consolidate in a single file python3-flask-socketio: Upgrade 4.2.1 -> 4.3.1 python3-google-api-python-client: Upgrade 1.10.0 -> 1.10.1 python3-cryptography: Upgrade 3.0 -> 3.1 python3-twitter: Upgrade 3.8.0 -> 3.9.0 python3-ntplib: Upgrade 0.3.3 -> 0.3.4 python3-flask-babel: Upgrade 1.0.0 -> 2.0.0 python3-flask-migrate: Consolidate in a single file python3-flask-migrate: Upgrade 2.5.2 -> 2.5.3 python3-flask-restful: Consolidate in a single file python3-flask-restful: Upgrade 0.3.7 -> 0.3.8 python3-flask-sqlalchemy: Consolidate in a single file python3-flask-sqlalchemy: Upgrade 2.4.1 -> 2.4.4 php: Upgrade 7.4.4 -> 7.4.9 python3-ecdsa: Upgrade 0.15 -> 0.16.0 python3-luma-core: Upgrade 1.15.0 -> 1.16.0 python3-cryptography-vectors: Upgrade 3.0 -> 3.1 python3-google-api-python-client: Upgrade 1.10.1 -> 1.11.0 python3-flask-user: Consolidate in a single file python3-cmd2: Upgrade 1.3.5 -> 1.3.8 python3-sh: Upgrade 1.13.1 -> 1.14.0 python3-paramiko: Upgrade 2.7.1 - 2.7.2 python3-parse: Upgrade 1.16.0 -> 1.17.0 python3-prompt-toolkit: Upgrade 3.0.6 -> 3.0.7 python3-more-itertools: Upgrade 8.4.0 -> 8.5.0 python3-ipython: Upgrade 7.17.0 -> 7.18.1 python3-hpack: Consolidate in a single file python3-hpack: Upgrade 3.0.0 -> 4.0.0 python3-sentry-sdk: Upgrade 0.17.0 -> 0.17.1 python3-luma-core: Upgrade 1.16.0 -> 1.16.1 python3-traitlets: Upgrade 4.3.3 -> 5.0.0 python3-flask-nav: Consolidate in a single file python3-flask-mail: Consolidate in a single file python3-flask-pymongo: Consolidate in a single file python3-pillow: Upgrade 6.2.1 -> 7.2.0 znc: Upgrade 1.7.5 -> 1.8.1 mosquitto: Upgrade 1.6.11 -> 1.6.12 fping: Upgrade 4.4 -> 5.0 nano: Upgrade 5.1 -> 5.2 hwdata: Upgrade 0.336 -> 0.339 xscreensaver: Add HOMEPAGE python3-meh: Upgrade 0.48 -> 0.49 python3-stevedore: Upgrade 3.2.0 -> 3.2.1 python3-robotframework: Upgrade 3.2.1 -> 3.2.2 python3-sentry-sdk: Upgrade 0.17.1 -> 0.17.2 python3-pycurl: Upgrade 7.43.0.5 -> 7.43.0.6 python3-pyzmq: Upgrade 17.1.0 -> 19.0.2 python3-mccabe: Upgrade 0.2.1 -> 0.6.1 python3-nmap: Upgrade 1.4.7 -> 1.4.8 python3-absl: Upgrade 0.9.0 -> 0.10.0 python3-systemd: Consolidate in a single file python3-gevent: Consolidate in a single file python3-gevent: Upgrade 1.4.0 -> 20.6.2 python3-ruamel-yaml: Upgrade 0.16.10 -> 0.16.11 python3-cmd2: Upgrade 1.3.8 -> 1.3.9 python3-traitlets: 5.0.0 -> 5.0.3 python3-priority: Consolidate in a single file python3-hyperframe: Consolidate in a single file python3-mprpc: Consolidate in a single file python3-gsocketpool: Consolidate in a single file gyp: Consolidate in a single file gyp: Upgrade to latest version python3-fann2: Consolidate in a single file python3-isort: Upgrade 5.4.2 -> 5.5.0 python3-sentry-sdk: Upgrade 0.17.2 -> 0.17.3 python3-hyperframe: Upgrade 5.2.0 -> 6.0.0 python3-traitlets: Upgrade 5.0.3 -> 5.0.4 python3-texttable: Upgrade 1.6.2 -> 1.6.3 python3-iso8601: Upgrade 0.1.12 -> 0.1.13 python3-dbus-next: Upgrade 0.1.3 -> 0.1.4 python3-ujson: Upgrade 3.1.0 -> 3.2.0 python3-trafaret: Upgrade 2.0.2 -> 2.1.0 python3-tqdm: Upgrade 4.48.2 -> 4.49.0 python3-isort: Upgrade 5.5.0 -> 5.5.2 python3-coverage: Upgrade 5.2.1 -> 5.3 python3-diskcache: Upgrade 5.0.2 -> 5.0.3 python3-haversine: Upgrade 2.2.0 -> 2.3.0 python3-pymysql: Upgrade 0.10.0 -> 0.10.1 python3-alembic: Upgrade 1.4.2 -> 1.4.3 python3-nocasedict: Upgrade 0.5.0 -> 1.0.0 python3-pyroute2: Upgrade 0.5.13 -> 0.5.14 python3-pyusb: Upgrade 1.0.2 -> 1.1.0 python3-pandas: Upgrade 1.1.1 -> 1.1.2 python3-pint: Upgrade 0.15 -> 0.16 python3-parse: Upgrade 1.17.0 -> 1.18.0 python3-cffi: Upgrade 1.14.2 -> 1.14.3 python3-google-api-python-client: Upgrade 1.11.0 -> 1.12.1 python3-sentry-sdk: Upgrade 0.17.3 -> 0.17.5 python3-attrs: Upgrade 20.1.0 -> 20.2.0 python3-nocaselist: Upgrade 1.0.1 -> 1.0.2 python3-pymisp: Upgrade 2.4.130 -> 2.4.131 python3-stevedore: Upgrade 3.2.1 -> 3.2.2 python3-matplotlib: Upgrade 3.3.1 -> 3.3.2 python3-pychromecast: Upgrade 7.2.1 -> 7.3.0 python3-pyrsistent: Upgrade 0.16.0 -> 0.17.3 python3-ruamel-yaml: Upgrade 0.16.11 -> 0.16.12 python3-msk: Upgrade 0.3.15 -> 0.3.16 Madhavan Krishnan (1): libcamera: Bumped to latest revision and added pkgconfig to enable gstreamer Marc (1): openocd: Update to latest git version Marek Vasut (1): freerdp: Add missing libxkbcommon WL dependency Martin Jansa (5): fbida: require opengl in DISTRO_FEATURES nss: fix postinst in do_rootfs for target nss: remove signlibs.sh st: add x11 to REQUIRED_DISTRO_FEATURES to suck less st: fix indentation Michael Fitz-Payne (1): python3-greenstalk: add recipe for greenstalk python package. Michael Vetter (2): jasper: Use new repo URL README: Use quotation marks for subject prefix Mikko Rapeli (4): nss: fix postinst script for nativesdk build mdns: update to version 1096.40.7 mdns: set CVE_PRODUCT to "apple:mdnsresponder" mdns: add BSD-3-Clause to LICENSE Mingli Yu (2): mariadb: package executables named with mariadb opencv: improve reproducibility Ola X Nilsson (1): syslog-ng: Drop obsolete variable ONLINE_PACKAGE_MANAGEMENT Oleksandr Kravchuk (1): tesseract: update to 4.1.1 Ovidiu Panait (1): net-snmp: upgrade 5.8 -> 5.9 Richard Leitner (1): liburing: add v0.7 Robert Joslyn (3): postgresql: Update to 12.4 htop: Update to 3.0.1 consolation: Add recipe Sakib Sajal (1): apache2: upgrade v2.4.43 -> v2.4.46 Slater, Joseph (2): openjpeg: fix CVE-2020-15389 luajit: advance SRCREV to fix two CVE's Stanislav Angelovic (1): Bump sdbus-c++ version to v0.8.3 Trevor Gamblin (3): packagegroup-meta-python: fix PACKAGES and default ptest recipe name python3-django: upgrade 2.2.13 -> 2.2.16 python3-django: add recipe for 3.1.1 Vincent Prince (1): mongodb: bump to r4.4.1 version Wenlin Kang (2): lua: fix CVE-2020-15945 lua: fix CVE-2020-24371 Yann Dirson (5): New terminal emulator: st 0.8.4 libcec: workaround wrong choice of PYTHON_PKG_DIR when building on Debian libcec: build with Linux CEC API libcec: rename libcec-tools to libcec-examples libcec: split the python example into a separate package Zang Ruochen (38): lftp: upgrade 4.9.1 -> 4.9.2 wireshark: upgrade 3.2.5 -> 3.2.6 leptonica: upgrade 1.79.0 -> 1.80.0 links: upgrade 2.20.2 -> 2.21 nano: upgrade 5.0 -> 5.1 nlohmann-json: upgrade 3.9.0 -> 3.9.1 openldap: upgrade 2.4.50 -> 2.4.51 protobuf: upgrade 3.12.3 -> 3.13.0 sanlock: upgrade 3.8.1 -> 3.8.2 libnet-dns-perl: upgrade 1.25 -> 1.26 libidn: upgrade 1.35 -> 1.36 satyr: upgrade 0.30 -> 0.31 spitools: upgrade 0.8.4 -> 0.8.5 fio: upgrade 3.21 -> 3.22 iperf3: upgrade 3.7 -> 3.9 paho-mqtt-c: upgrade 1.3.4 -> 1.3.5 purple-skypeweb: upgrade 1.6 -> 1.7 libdbd-sqlite-perl: upgrade 1.64 -> 1.66 libencode-perl: upgrade 3.06 -> 3.07 dash: upgrade 0.5.11.1 -> 0.5.11.2 fuse3: upgrade 3.9.2 -> 3.9.3 gperftools: upgrade 2.7.90 -> 2.8 xfsprogs: upgrade 5.7.0 -> 5.8.0 cifs-utils: upgrade 6.10 -> 6.11 libdnet: upgrade 1.12 -> 1.14 asio: upgrade 1.16.1 -> 1.18.0 collectd: upgrade 5.11.0 -> 5.12.0 cryptsetup: upgrade 2.3.3 -> 2.3.4 gsoap: upgrade 2.0.105 -> 2.0.106 jasper: upgrade 2.0.19 -> 2.0.20 lcms: upgrade 2.9 -> 2.11 libhugetlbfs: upgrade 2.22 -> 2.23 ostree: upgrade 2020.5 -> 2020.6 poppler: upgrade 20.08.0 -> 20.09.0 redis: upgrade 6.0.6 -> 6.0.7 spdlog: upgrade 1.7.0 -> 1.8.0 zeromq: upgrade 4.3.2 -> 4.3.3 python3-test-generator: Enable ptest leckijakub (1): cukinia: new package Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I8382b605a3c059a037b8f4db53608f505da642ed
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-devtools/lua')
-rw-r--r--meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Fixed-bug-barriers-cannot-be-active-during-sweep.patch90
-rw-r--r--meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2020-15945.patch167
-rw-r--r--meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb2
3 files changed, 259 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Fixed-bug-barriers-cannot-be-active-during-sweep.patch b/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Fixed-bug-barriers-cannot-be-active-during-sweep.patch
new file mode 100644
index 0000000000..a302874d76
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Fixed-bug-barriers-cannot-be-active-during-sweep.patch
@@ -0,0 +1,90 @@
+From 1e6df25ac28dcd89f0324177bb55019422404b44 Mon Sep 17 00:00:00 2001
+From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
+Date: Thu, 3 Sep 2020 15:32:17 +0800
+Subject: [PATCH] Fixed bug: barriers cannot be active during sweep
+
+Barriers cannot be active during sweep, even in generational mode.
+(Although gen. mode is not incremental, it can hit a barrier when
+deleting a thread and closing its upvalues.) The colors of objects are
+being changed during sweep and, therefore, cannot be trusted.
+
+Upstream-Status: Backport [https://github.com/lua/lua/commit/a6da1472c0c5e05ff249325f979531ad51533110]
+CVE: CVE-2020-24371
+
+[Adjust code KGC_INC -> KGC_NORMAL, refer 69371c4b84becac09c445aae01d005b49658ef82]
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ src/lgc.c | 33 ++++++++++++++++++++++++---------
+ 1 file changed, 24 insertions(+), 9 deletions(-)
+
+diff --git a/src/lgc.c b/src/lgc.c
+index 973c269..7af23d5 100644
+--- a/src/lgc.c
++++ b/src/lgc.c
+@@ -142,10 +142,17 @@ static int iscleared (global_State *g, const TValue *o) {
+
+
+ /*
+-** barrier that moves collector forward, that is, mark the white object
+-** being pointed by a black object. (If in sweep phase, clear the black
+-** object to white [sweep it] to avoid other barrier calls for this
+-** same object.)
++** Barrier that moves collector forward, that is, marks the white object
++** 'v' being pointed by the black object 'o'. In the generational
++** mode, 'v' must also become old, if 'o' is old; however, it cannot
++** be changed directly to OLD, because it may still point to non-old
++** objects. So, it is marked as OLD0. In the next cycle it will become
++** OLD1, and in the next it will finally become OLD (regular old). By
++** then, any object it points to will also be old. If called in the
++** incremental sweep phase, it clears the black object to white (sweep
++** it) to avoid other barrier calls for this same object. (That cannot
++** be done is generational mode, as its sweep does not distinguish
++** whites from deads.)
+ */
+ void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) {
+ global_State *g = G(L);
+@@ -154,7 +161,8 @@ void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) {
+ reallymarkobject(g, v); /* restore invariant */
+ else { /* sweep phase */
+ lua_assert(issweepphase(g));
+- makewhite(g, o); /* mark main obj. as white to avoid other barriers */
++ if (g->gckind == KGC_NORMAL) /* incremental mode? */
++ makewhite(g, o); /* mark 'o' as white to avoid other barriers */
+ }
+ }
+
+@@ -299,10 +307,15 @@ static void markbeingfnz (global_State *g) {
+
+
+ /*
+-** Mark all values stored in marked open upvalues from non-marked threads.
+-** (Values from marked threads were already marked when traversing the
+-** thread.) Remove from the list threads that no longer have upvalues and
+-** not-marked threads.
++** For each non-marked thread, simulates a barrier between each open
++** upvalue and its value. (If the thread is collected, the value will be
++** assigned to the upvalue, but then it can be too late for the barrier
++** to act. The "barrier" does not need to check colors: A non-marked
++** thread must be young; upvalues cannot be older than their threads; so
++** any visited upvalue must be young too.) Also removes the thread from
++** the list, as it was already visited. Removes also threads with no
++** upvalues, as they have nothing to be checked. (If the thread gets an
++** upvalue later, it will be linked in the list again.)
+ */
+ static void remarkupvals (global_State *g) {
+ lua_State *thread;
+@@ -313,9 +326,11 @@ static void remarkupvals (global_State *g) {
+ p = &thread->twups; /* keep marked thread with upvalues in the list */
+ else { /* thread is not marked or without upvalues */
+ UpVal *uv;
++ lua_assert(!isold(thread) || thread->openupval == NULL);
+ *p = thread->twups; /* remove thread from the list */
+ thread->twups = thread; /* mark that it is out of list */
+ for (uv = thread->openupval; uv != NULL; uv = uv->u.open.next) {
++ lua_assert(getage(uv) <= getage(thread));
+ if (uv->u.open.touched) {
+ markvalue(g, uv->v); /* remark upvalue's value */
+ uv->u.open.touched = 0;
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2020-15945.patch b/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2020-15945.patch
new file mode 100644
index 0000000000..89ce491487
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2020-15945.patch
@@ -0,0 +1,167 @@
+From d8d344365945a534f700c82c5dd26f704f89fef3 Mon Sep 17 00:00:00 2001
+From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
+Date: Wed, 5 Aug 2020 16:59:58 +0800
+Subject: [PATCH] Fixed bug: invalid 'oldpc' when returning to a function
+
+The field 'L->oldpc' is not always updated when control returns to a
+function; an invalid value can seg. fault when computing 'changedline'.
+(One example is an error in a finalizer; control can return to
+'luaV_execute' without executing 'luaD_poscall'.) Instead of trying to
+fix all possible corner cases, it seems safer to be resilient to invalid
+values for 'oldpc'. Valid but wrong values at most cause an extra call
+to a line hook.
+
+CVE: CVE-2020-15945
+
+[Adjust the code to be applicable to the tree]
+
+Upstream-Status: Backport [https://github.com/lua/lua/commit/a2195644d89812e5b157ce7bac35543e06db05e3]
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+Signed-off-by: Joe Slater <joe.slater@@windriver.com>
+
+---
+ src/ldebug.c | 30 +++++++++++++++---------------
+ src/ldebug.h | 4 ++++
+ src/ldo.c | 2 +-
+ src/lstate.c | 1 +
+ src/lstate.h | 2 +-
+ 5 files changed, 22 insertions(+), 17 deletions(-)
+
+diff --git a/src/ldebug.c b/src/ldebug.c
+index 239affb..832b16c 100644
+--- a/src/ldebug.c
++++ b/src/ldebug.c
+@@ -34,9 +34,8 @@
+ #define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_TCCL)
+
+
+-/* Active Lua function (given call info) */
+-#define ci_func(ci) (clLvalue((ci)->func))
+-
++/* inverse of 'pcRel' */
++#define invpcRel(pc, p) ((p)->code + (pc) + 1)
+
+ static const char *funcnamefromcode (lua_State *L, CallInfo *ci,
+ const char **name);
+@@ -71,20 +70,18 @@ static void swapextra (lua_State *L) {
+
+ /*
+ ** This function can be called asynchronously (e.g. during a signal).
+-** Fields 'oldpc', 'basehookcount', and 'hookcount' (set by
+-** 'resethookcount') are for debug only, and it is no problem if they
+-** get arbitrary values (causes at most one wrong hook call). 'hookmask'
+-** is an atomic value. We assume that pointers are atomic too (e.g., gcc
+-** ensures that for all platforms where it runs). Moreover, 'hook' is
+-** always checked before being called (see 'luaD_hook').
++** Fields 'basehookcount' and 'hookcount' (set by 'resethookcount')
++** are for debug only, and it is no problem if they get arbitrary
++** values (causes at most one wrong hook call). 'hookmask' is an atomic
++** value. We assume that pointers are atomic too (e.g., gcc ensures that
++** for all platforms where it runs). Moreover, 'hook' is always checked
++** before being called (see 'luaD_hook').
+ */
+ LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
+ if (func == NULL || mask == 0) { /* turn off hooks? */
+ mask = 0;
+ func = NULL;
+ }
+- if (isLua(L->ci))
+- L->oldpc = L->ci->u.l.savedpc;
+ L->hook = func;
+ L->basehookcount = count;
+ resethookcount(L);
+@@ -665,7 +662,10 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
+ void luaG_traceexec (lua_State *L) {
+ CallInfo *ci = L->ci;
+ lu_byte mask = L->hookmask;
++ const Proto *p = ci_func(ci)->p;
+ int counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT));
++ /* 'L->oldpc' may be invalid; reset it in this case */
++ int oldpc = (L->oldpc < p->sizecode) ? L->oldpc : 0;
+ if (counthook)
+ resethookcount(L); /* reset count */
+ else if (!(mask & LUA_MASKLINE))
+@@ -677,15 +677,15 @@ void luaG_traceexec (lua_State *L) {
+ if (counthook)
+ luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */
+ if (mask & LUA_MASKLINE) {
+- Proto *p = ci_func(ci)->p;
+ int npc = pcRel(ci->u.l.savedpc, p);
+ int newline = getfuncline(p, npc);
+ if (npc == 0 || /* call linehook when enter a new function, */
+- ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */
+- newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */
++ ci->u.l.savedpc <= invpcRel(oldpc, p) || /* when jump back (loop), or when */
++ newline != getfuncline(p, oldpc)) /* enter a new line */
+ luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */
++
++ L->oldpc = npc; /* 'pc' of last call to line hook */
+ }
+- L->oldpc = ci->u.l.savedpc;
+ if (L->status == LUA_YIELD) { /* did hook yield? */
+ if (counthook)
+ L->hookcount = 1; /* undo decrement to zero */
+diff --git a/src/ldebug.h b/src/ldebug.h
+index 0e31546..c224cc4 100644
+--- a/src/ldebug.h
++++ b/src/ldebug.h
+@@ -13,6 +13,10 @@
+
+ #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
+
++/* Active Lua function (given call info) */
++#define ci_func(ci) (clLvalue((ci)->func))
++
++
+ #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1)
+
+ #define resethookcount(L) (L->hookcount = L->basehookcount)
+diff --git a/src/ldo.c b/src/ldo.c
+index 90b695f..f66ac1a 100644
+--- a/src/ldo.c
++++ b/src/ldo.c
+@@ -382,7 +382,7 @@ int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, int nres) {
+ luaD_hook(L, LUA_HOOKRET, -1);
+ firstResult = restorestack(L, fr);
+ }
+- L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
++ L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* 'oldpc' for caller function */
+ }
+ res = ci->func; /* res == final position of 1st result */
+ L->ci = ci->previous; /* back to caller */
+diff --git a/src/lstate.c b/src/lstate.c
+index 9194ac3..3573e36 100644
+--- a/src/lstate.c
++++ b/src/lstate.c
+@@ -236,6 +236,7 @@ static void preinit_thread (lua_State *L, global_State *g) {
+ L->nny = 1;
+ L->status = LUA_OK;
+ L->errfunc = 0;
++ L->oldpc = 0;
+ }
+
+
+diff --git a/src/lstate.h b/src/lstate.h
+index a469466..d75eadf 100644
+--- a/src/lstate.h
++++ b/src/lstate.h
+@@ -164,7 +164,6 @@ struct lua_State {
+ StkId top; /* first free slot in the stack */
+ global_State *l_G;
+ CallInfo *ci; /* call info for current function */
+- const Instruction *oldpc; /* last pc traced */
+ StkId stack_last; /* last free slot in the stack */
+ StkId stack; /* stack base */
+ UpVal *openupval; /* list of open upvalues in this stack */
+@@ -174,6 +173,7 @@ struct lua_State {
+ CallInfo base_ci; /* CallInfo for first level (C calling Lua) */
+ volatile lua_Hook hook;
+ ptrdiff_t errfunc; /* current error handling function (stack index) */
++ int oldpc; /* last pc traced */
+ int stacksize;
+ int basehookcount;
+ int hookcount;
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb b/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
index d3461b06de..7d84ea60b6 100644
--- a/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
+++ b/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
@@ -8,6 +8,8 @@ SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
file://lua.pc.in \
file://0001-Allow-building-lua-without-readline-on-Linux.patch \
file://CVE-2020-15888.patch \
+ file://CVE-2020-15945.patch \
+ file://0001-Fixed-bug-barriers-cannot-be-active-during-sweep.patch \
"
# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release.