summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhsan Hussain <ahsan_hussain@mentor.com>2022-01-31 13:55:48 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-12 17:05:35 +0000
commit8c18d70e3d3ea80e0204ca3d5ff79183493235c5 (patch)
treecb3352ef2232b21fd1a4101f73d72ba5f089a1af
parent5bc518e81bb627b0e20f54f4823f4027698b910f (diff)
downloadpoky-8c18d70e3d3ea80e0204ca3d5ff79183493235c5.tar.gz
staging: use relative path in sysroot_stage_dir()
A regression form cpio CVE-2021-38185 caused the tool to hang for paths greater than 128 character long. It was reported here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992098 We were able to reliable reproduce this with dunfell, meta-freescale recipe imx-boot https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-bsp/imx-mkimage/imx-boot_1.0.bb Using relative path on the affected host fixes the issue as this is always short, being in the same work dir. It would be harmless, and useful to generally use the relative path for sysroot_stage_dir() (From OE-Core rev: a1ec3154a53fd9e3f87a53f25113b7f90bcfb489) Signed-off-by: Ahsan Hussain <ahsan_hussain@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/staging.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index b8a14ff02e..71302b6e12 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -49,9 +49,10 @@ sysroot_stage_dir() {
49 fi 49 fi
50 50
51 mkdir -p "$dest" 51 mkdir -p "$dest"
52 rdest=$(realpath --relative-to="$src" "$dest")
52 ( 53 (
53 cd $src 54 cd $src
54 find . -print0 | cpio --null -pdlu $dest 55 find . -print0 | cpio --null -pdlu $rdest
55 ) 56 )
56} 57}
57 58