sys-apps/sandbox: Fix opendir sandbox abort with long paths
authorMart Raudsepp <leio@gentoo.org>
Fri, 30 Dec 2016 08:35:38 +0000 (10:35 +0200)
committerMart Raudsepp <leio@gentoo.org>
Fri, 30 Dec 2016 08:49:48 +0000 (10:49 +0200)
commit3a9eb02cfe4cde0373b309d67fe1fb83c68d7ec5
tree3ac3d06f51d5cefdfd0df8ee37023a2c4736ac1d
parent4b0a9ae167be4dc0cc9db385c84fd705a1b64301
sys-apps/sandbox: Fix opendir sandbox abort with long paths

Shell globbing code could end up calling opendir on a whole command line
with arguments, exceeding 8k characters - for example when libtool gets
passed an -export-symbols-regex with a wildcard.
Due to the length exceeding sandbox internal SB_PATH_MAX, it gets trimmed
internally in sandbox syscall checks (even though opendir isn't an actual
syscall), gets confused and throws an ISE abort.
Fix it by adding a precheck that simply fails early with ENAMETOOLONG on
too long paths, as the real glibc function would do the same.

Fixes large projects hitting sandbox abort inside the driving POSIX shell
globbing function due to a long list of linker arguments (such as many object
files) being passed to libtool together with an -export-symbols-regex with
a wildcard. Known affected packages include graphicsmagick and newer
gnome-builder.

p.masked for a short time as a maintainer timeout, seeking independent
validation as a critical packages non-maintainer revbump.

Gentoo-Bug: 553092
Package-Manager: portage-2.3.3
Signed-off-by: Mart Raudsepp <leio@gentoo.org>
profiles/package.mask
sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch [new file with mode: 0644]
sys-apps/sandbox/sandbox-2.10-r3.ebuild [new file with mode: 0644]
sys-apps/sandbox/sandbox-2.11-r4.ebuild [new file with mode: 0644]