Skip to contentSkip to conversation

Review request

PATCH In review Anuj Mittal 2 participants 7 messages Sep 21, 2021 – Sep 22, 2021

lore
Share & tools
lore
#0 lore raw

cover Review request

Please review these changes for hardknott. One intermittent ltp failure seen for qemuarm64.

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/2625

Thanks,

Anuj

The following changes since commit e99578cde6078828a3075e10f1bb97e1a373ce12:

linux-yocto/5.4: update to v5.4.144 (2021-09-16 00:56:36 +0800)

are available in the Git repository at:

git://push.openembedded.org/openembedded-core-contrib anujm/hardknott

Armin Kuster (1):
tar: ignore node-tar CVEs

Kiran Surendran (1):
ffmpeg: fix CVE-2021-38114

Mark Hatle (1):
externalsrc: Work with reproducible_build

Richard Purdie (1):
sstate: Avoid problems with recipes using SRCPV when fetching sstate

 meta/classes/externalsrc.bbclass              | 10 +++
 meta/classes/sstate.bbclass                   |  4 ++
 meta/recipes-extended/tar/tar_1.34.bb         |  1 +
 .../ffmpeg/ffmpeg/fix-CVE-2021-38114.patch    | 67 +++++++++++++++++++
 .../recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb |  1 +
 5 files changed, 83 insertions(+)
 create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/4 sstate: Avoid problems with recipes using SRCPV when fetching sstate

From: Richard Purdie <[email protected]>

When fetching sstate, SRCPV can be expanded withuin PV which breaks the sstate fetcher as other variables like SRC_URI are changed by the fetcher code. Expand the variable before doing this to avoid those problems and hence avoid setscene task failures with remote sstate storage in git recipes.

(cherry picked from commit 0d9d7acebe0be42d4cf8a30ecbbbbcb2dfd16a4b)
---
 meta/classes/sstate.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/sstate.bbclass +4 -0
index 4bf087b4e8..8b4bfc25b7 100644
@@ -731,6 +731,7 @@ def pstaging_fetch(sstatefetch, d):
     localdata.setVar('FILESPATH', dldir)
     localdata.setVar('DL_DIR', dldir)
     localdata.setVar('PREMIRRORS', mirrors)
+    localdata.setVar('SRCPV', d.getVar('SRCPV'))
 
     # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
     # we'll want to allow network access for the current set of fetches.
@@ -755,6 +756,9 @@ def pstaging_fetch(sstatefetch, d):
         except bb.fetch2.BBFetchException:
             pass
 
+pstaging_fetch[vardepsexclude] += "SRCPV"
+
+
 def sstate_setscene(d):
     shared_state = sstate_state_fromvars(d)
     accelerate = sstate_installpkg(shared_state, d)
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/4 tar: ignore node-tar CVEs

In reply to Anuj Mittal

From: Armin Kuster <[email protected]>

These three CVEs are specific to the Node package node-tar.

exclude: CVE-2021-37701 CVE-2021-37712 CVE-2021-37713

(cherry picked from commit 9f9317a02d73c1e5aea026683a037e52c996c7bb)
---
 meta/recipes-extended/tar/tar_1.34.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/tar/tar_1.34.bb +1 -0
index 66c11cbfea..f41e5b33d4 100644
@@ -64,3 +64,4 @@ BBCLASSEXTEND = "native nativesdk"
 
 # These are both specific to the NPM package node-tar
 CVE_CHECK_WHITELIST += "CVE-2021-32803 CVE-2021-32804"
+CVE_CHECK_WHITELIST += "CVE-2021-37701 CVE-2021-37712 CVE-2021-37713"
Signature · 1 line
2.31.1
#3 lore raw

PATCH 3/4 externalsrc: Work with reproducible_build

In reply to Anuj Mittal

From: Mark Hatle <[email protected]>

Externalsrc removes do_fetch, do_unpack, and do_patch. The system normally discovers the correct reproducible date as a postfuncs of do_unpack, so this date is never found, so it falls back to the default epoch.

Instead we can move the discovery function to a prefuncs on the epoch deploy task. This task will run before do_configure, and since the source is already available can run safely at anytime.

(cherry picked from commit 0b7dd711a54e92ce54abe99f59fc67e683d52dfe)
---
 meta/classes/externalsrc.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/classes/externalsrc.bbclass +10 -0
index 3d6b80bee2..1ea938fb62 100644
@@ -110,6 +110,16 @@ python () {
                 continue
             bb.build.deltask(task, d)
 
+        if bb.data.inherits_class('reproducible_build', d) and 'do_unpack' in d.getVar("SRCTREECOVEREDTASKS").split():
+            # The reproducible_build's create_source_date_epoch_stamp function must
+            # be run after the source is available and before the
+            # do_deploy_source_date_epoch task.  In the normal case, it's attached
+            # to do_unpack as a postfuncs, but since we removed do_unpack (above)
+            # we need to move the function elsewhere.  The easiest thing to do is
+            # move it into the prefuncs of the do_deploy_source_date_epoch task.
+            # This is safe, as externalsrc runs with the source already unpacked.
+            d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
+
         d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
         d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")
 
Signature · 1 line
2.31.1
#4 lore raw

Re: [OE-core] [hardknott][PATCH 3/4] externalsrc: Work with reproducible_build

Quoted 30 lines · Anuj Mittal

From: Mark Hatle <[email protected]>

Externalsrc removes do_fetch, do_unpack, and do_patch. The system normally discovers the correct reproducible date as a postfuncs of do_unpack, so this date is never found, so it falls back to the default epoch.

Instead we can move the discovery function to a prefuncs on the epoch deploy task. This task will run before do_configure, and since the source is already available can run safely at anytime.

(cherry picked from commit 0b7dd711a54e92ce54abe99f59fc67e683d52dfe)
---
 meta/classes/externalsrc.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/classes/externalsrc.bbclass +3 -0
index 3d6b80bee2..1ea938fb62 100644
@@ -110,6 +110,16 @@ python () {
                 continue
             bb.build.deltask(task, d)
 
+        if bb.data.inherits_class('reproducible_build', d) and 'do_unpack' in d.getVar("SRCTREECOVEREDTASKS").split():
+            # The reproducible_build's create_source_date_epoch_stamp function must
+            # be run after the source is available and before the

meta/classes/externalsrc.bbclass python () { · line 125

Quoted 10 lines
meta/classes/externalsrc.bbclass +7 -0
+            # do_deploy_source_date_epoch task.  In the normal case, it's attached
+            # to do_unpack as a postfuncs, but since we removed do_unpack (above)
+            # we need to move the function elsewhere.  The easiest thing to do is
+            # move it into the prefuncs of the do_deploy_source_date_epoch task.
+            # This is safe, as externalsrc runs with the source already unpacked.
+            d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
+
         d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
         d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")
 

I am a little concerned about this one. I think it may introduce a race. We saw this on the autobuilder.

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/2594/steps/14/logs/stdio

I did quickly put this patch together:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t222&id=bcf46a5f12ae15713a53297342d8341b73c16d94

but I haven;t tested it or tried to debug/confirm as yet.

Cheers,

Richard

#5 lore raw

Re: [OE-core] [hardknott][PATCH 3/4] externalsrc: Work with reproducible_build

Quoted 62 lines · Richard Purdie
Quoted 48 lines · Anuj Mittal

From: Mark Hatle <[email protected]>

Externalsrc removes do_fetch, do_unpack, and do_patch.  The system normally
discovers the correct reproducible date as a postfuncs of do_unpack, so this
date is never found, so it falls back to the default epoch.

Instead we can move the discovery function to a prefuncs on the epoch
deploy task.  This task will run before do_configure, and since the source
is already available can run safely at anytime.

(cherry picked from commit

0b7dd711a54e92ce54abe99f59fc67e683d52dfe)

---
 meta/classes/externalsrc.bbclass | 10 ++++++++++

 1 file changed, 10 insertions(+)
meta/classes/externalsrc.bbclass +0 -0
index 3d6b80bee2..1ea938fb62 100644
@@ -110,6 +110,16 @@ python () {

                 continue
             bb.build.deltask(task, d)

+        if bb.data.inherits_class('reproducible_build', d) and 'do_unpack' in d.getVar("SRCTREECOVEREDTASKS").split():
+            # The reproducible_build's create_source_date_epoch_stamp function must
+            # be run after the source is available and before the +            # do_deploy_source_date_epoch task.  In the normal case, it's attached
+            # to do_unpack as a postfuncs, but since we removed do_unpack (above)
+            # we need to move the function elsewhere.  The easiest thing to do is
+            # move it into the prefuncs of the do_deploy_source_date_epoch task.
+            # This is safe, as externalsrc runs with the source already unpacked.

Quoted 8 lines

+            d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
+
         d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ") d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")

I am a little concerned about this one. I think it may introduce a race. We saw
this on the autobuilder.

Quoted 8 lines

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/2594/steps/14/logs/stdio

I did quickly put this patch together:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t222&id=bcf46a5f12ae15713a53297342d8341b73c16d94

but I haven;t tested it or tried to debug/confirm as yet.

Oh okay, I will drop this change for now in that case.

Thanks,

Anuj

#6 lore raw

PATCH 4/4 ffmpeg: fix CVE-2021-38114

In reply to Anuj Mittal

From: Kiran Surendran <[email protected]>

backport from upstream

---
 .../ffmpeg/ffmpeg/fix-CVE-2021-38114.patch    | 67 +++++++++++++++++++
 .../recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb |  1 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch
meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch new file +67 -0
new file mode 100644
index 0000000000..3de7cf7e0f
@@ -0,0 +1,67 @@
+CVE: CVE-2021-38114
+Upstream-Status: Backport
+Signed-off-by: Kiran Surendran <[email protected]>
+
+From 662aef4aacf23b4be4c1cfaebd837e225b357e51 Mon Sep 17 00:00:00 2001
+From: maryam ebr <[email protected]>
+Date: Tue, 3 Aug 2021 01:05:47 -0400
+Subject: [PATCH] avcodec/dnxhddec: check and propagate function return value
+
+Similar to CVE-2013-0868, here return value check for 'init_vlc' is needed.
+crafted DNxHD data can cause unspecified impact.
+
+Reviewed-by: Paul B Mahol <[email protected]>
+Signed-off-by: James Almer <[email protected]>
+---
+ libavcodec/dnxhddec.c | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
+index e5d01e2e71..54f894f81b 100644
+--- a/libavcodec/dnxhddec.c
++++ b/libavcodec/dnxhddec.c
+@@ -110,6 +110,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
+ 
+ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth)
+ {
++    int ret;
+     if (cid != ctx->cid) {
+         int index;
+ 
+@@ -129,19 +130,26 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth)
+         ff_free_vlc(&ctx->dc_vlc);
+         ff_free_vlc(&ctx->run_vlc);
+ 
+-        init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,
++        if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,
+                  ctx->cid_table->ac_bits, 1, 1,
+-                 ctx->cid_table->ac_codes, 2, 2, 0);
+-        init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12,
++                 ctx->cid_table->ac_codes, 2, 2, 0)) < 0)
++            goto out;
++        if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12,
+                  ctx->cid_table->dc_bits, 1, 1,
+-                 ctx->cid_table->dc_codes, 1, 1, 0);
+-        init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62,
++                 ctx->cid_table->dc_codes, 1, 1, 0)) < 0)
++            goto out;
++        if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62,
+                  ctx->cid_table->run_bits, 1, 1,
+-                 ctx->cid_table->run_codes, 2, 2, 0);
++                 ctx->cid_table->run_codes, 2, 2, 0)) < 0)
++            goto out;
+ 
+         ctx->cid = cid;
+     }
+-    return 0;
++    ret = 0;
++out:
++    if (ret < 0)
++        av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n");
++    return ret;
+ }
+ 
+ static int dnxhd_get_profile(int cid)
+-- 
+2.31.1
+
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +1 -0
index 3162617336..2df8fc45cf 100644
@@ -33,6 +33,7 @@ SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
            file://fix-CVE-2020-22033-CVE-2020-22019.patch \
            file://fix-CVE-2021-38291.patch \
            file://fix-CVE-2021-38171.patch \
+           file://fix-CVE-2021-38114.patch \
            "
 SRC_URI[sha256sum] = "46e4e64f1dd0233cbc0934b9f1c0da676008cad34725113fb7f802cfa84ccddb"
 
Signature · 1 line
2.31.1