devtool: deploy-target: support "unsafe" symlinks
PATCH 1/1 devtool: deploy-target: support "unsafe" symlinks
The bosybox version of tar considers symlink targets that start with / or with ../ to be unsafe and refuses to unpack them unless the EXTRACT_UNSAFE_SYMLINKS environment variable is set to 1.
As even many core packages legitimately contain such links (e.g. coreutils-locale-*, dropbear, eudev, initscripts, kmod, ...), add the environment variable to the remote script.
--- scripts/lib/devtool/deploy.py | 1 + 1 file changed, 1 insertion(+)
scripts/lib/devtool/deploy.py +1 -0
@@ -114,6 +114,7 @@ def _prepare_remote_script(deploy, verbose=False, dryrun=False, undeployall=Fals lines.append('rm $3') lines.append('mkdir -p `dirname $manifest`') lines.append('mkdir -p $2') + lines.append('export EXTRACT_UNSAFE_SYMLINKS=1') if verbose: lines.append(' tar xv -C $2 -f - | tee $manifest') else:
Signature · 1 line
2.11.0
Quoted 8 lines · Olaf Mandel
The bosybox version of tar considers symlink targets that start with / or with ../ to be unsafe and refuses to unpack them unless the
EXTRACT_UNSAFE_SYMLINKSenvironment variable is set to 1.As even many core packages legitimately contain such links (e.g. coreutils-locale-*, dropbear, eudev, initscripts, kmod, ...), add the environment variable to the remote script.
Upstream Busybox seems to have a different solution, so perhaps worth adding a comment that EXTRACT_UNSAFE_SYMLINKS is a temporary / version-specific fix.
https://git.busybox.net/busybox/commit/?h=1_28_stable&id=37277a23fe48b13313f5d96084d890ed21d5fd8b
Quoted 24 lines
--- scripts/lib/devtool/deploy.py | 1 + 1 file changed, 1 insertion(+)scripts/lib/devtool/deploy.py +1
-1@@ -114,6 +114,7 @@ def _prepare_remote_script(deploy, verbose=False, dryrun=False, undeployall=Fals lines.append('rm $3') lines.append('mkdir -p `dirname $manifest`') lines.append('mkdir -p $2') + lines.append('export EXTRACT_UNSAFE_SYMLINKS=1') if verbose: lines.append(' tar xv -C $2 -f - | tee $manifest') else: --2.11.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
PATCH v2 1/1 devtool: deploy-target: support "unsafe" symlinks
The bosybox version of tar in sumo considers symlink targets that start with / or with ../ to be unsafe and refuses to unpack them unless the EXTRACT_UNSAFE_SYMLINKS environment variable is set to 1.
As even many core packages legitimately contain such links (e.g. coreutils-locale-*, dropbear, eudev, initscripts, kmod, ...), add the environment variable to the remote script.
--- scripts/lib/devtool/deploy.py | 5 +++++ 1 file changed, 5 insertions(+)
scripts/lib/devtool/deploy.py +5 -0
@@ -114,6 +114,11 @@ def _prepare_remote_script(deploy, verbose=False, dryrun=False, undeployall=Fals lines.append('rm $3') lines.append('mkdir -p `dirname $manifest`') lines.append('mkdir -p $2') + # Busybox tar v1.28.x (plus v1.27.2 with the CVE-2011-5325 patch) + # requires this env variable. The first release without this issue + # is thud. + # FIXME Remove once sumo goes out of support + lines.append('export EXTRACT_UNSAFE_SYMLINKS=1') if verbose: lines.append(' tar xv -C $2 -f - | tee $manifest') else:
Signature · 1 line
2.11.0
Quoted 11 lines · Olaf Mandel
The bosybox version of tar in sumo considers symlink targets that start
with / or with ../ to be unsafe and refuses to unpack them unless theEXTRACT_UNSAFE_SYMLINKSenvironment variable is set to 1.As even many core packages legitimately contain such links (e.g. coreutils-locale-*, dropbear, eudev, initscripts, kmod, ...), add the environment variable to the remote script.
--- scripts/lib/devtool/deploy.py | 5 +++++ 1 file changed, 5 insertions(+)
I'm tempted to suggest we backport changes to busybox in sumo to address this...
Cheers,
Richard