new file mode 100644
@@ -0,0 +1,38 @@
+Crazy shell code (e.g. libtool) can pass in a command pipeline as a path which exceeds the max path
+length the system can support (6000+ chars). This will fail in libc or the syscall but if we don't
+do something here, we'd segfault before it can do that. Leave path unchanged and let libc deal
+with it.
+
+This was observed with segfaults in libfm:do_install after the libtool upgrade. It does depend on
+the length of the local build path too.
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: git/pseudo_util.c
+===================================================================
+--- git.orig/pseudo_util.c
++++ git/pseudo_util.c
+@@ -810,12 +810,21 @@ pseudo_fix_path(const char *base, const
+ return 0;
+ }
+ newpathlen = pseudo_path_max();
++ pathlen = strlen(path);
++ /* Crazy shell code (e.g. libtool) can pass in a command pipeline as a path which exceeds the max path
++ * length the system can support (6000+ chars). This will fail in libc or the syscall but if we don't
++ * do something here, we'd segfault before it can do that. Leave path unchanged and let libc deal
++ * with it.
++ */
++ if ((pathlen + baselen) >= newpathlen) {
++ return path;
++ }
+ if (!pathbufs[pathbuf]) {
+ pathbufs[pathbuf] = malloc(newpathlen);
+ }
+ newpath = pathbufs[pathbuf];
+ pathbuf = (pathbuf + 1) % PATHBUFS;
+- pathlen = strlen(path);
++
+ /* a trailing slash has special meaning, but processing
+ * trailing slashes is expensive.
+ */
@@ -2,6 +2,7 @@ require pseudo.inc
SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
file://0001-configure-Prune-PIE-flags.patch \
+ file://pathlength.patch \
file://fallback-passwd \
file://fallback-group \
"
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- .../pseudo/files/pathlength.patch | 38 +++++++++++++++++++ meta/recipes-devtools/pseudo/pseudo_git.bb | 1 + 2 files changed, 39 insertions(+) create mode 100644 meta/recipes-devtools/pseudo/files/pathlength.patch