From patchwork Thu Jan 15 23:43:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A402BD47CBF for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.753.1768520620774065173 for ; Thu, 15 Jan 2026 15:43:41 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjW2408772; Thu, 15 Jan 2026 17:43:38 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 01/20] test-syscall: Remove build warning Date: Thu, 15 Jan 2026 17:43:17 -0600 Message-Id: <1768520616-7289-2-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2977 Compiler is warning about argc and argv not being used. Signed-off-by: Mark Hatle --- test/test-syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-syscall.c b/test/test-syscall.c index 1e21525..9031766 100644 --- a/test/test-syscall.c +++ b/test/test-syscall.c @@ -11,7 +11,7 @@ #include #include -int main(int argc, char *argv[]) { +int main() { long rc = 0; #ifdef SYS_renameat2 From patchwork Thu Jan 15 23:43:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8830ED47CBB for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.754.1768520620774151045 for ; Thu, 15 Jan 2026 15:43:41 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjX2408772; Thu, 15 Jan 2026 17:43:39 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 02/20] test: Cleanup test output Date: Thu, 15 Jan 2026 17:43:18 -0600 Message-Id: <1768520616-7289-3-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2976 Change 'make test' to be simple test results. Add new 'make test-verbose' for verbose results. Adjust the run_test.sh to capture logs and only output when in verbose mode. Also capture failure and skip counts. (rc of 255 indicates test was skipped.) Adjust test cases to indicate skipped tests when a command is unavailable. Signed-off-by: Mark Hatle --- Makefile.in | 3 +++ run_tests.sh | 24 +++++++++++++++++++----- test/test-acl.sh | 16 ++++++++++++++++ test/test-xattr.sh | 17 +++++++++++++++++ 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6447be4..3b60cf8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,6 +76,9 @@ TABLES=table_templates/pseudo_tables.c table_templates/pseudo_tables.h all: $(LIBPSEUDO) $(PSEUDO) $(PSEUDODB) $(PSEUDOLOG) $(PSEUDO_PROFILE) test: all $(TESTS) | $(BIN) $(LIB) + ./run_tests.sh + +test-verbose: all $(TESTS) | $(BIN) $(LIB) ./run_tests.sh -v test/test-%: test/test-%.c diff --git a/run_tests.sh b/run_tests.sh index c637c27..3d0920f 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -31,22 +31,36 @@ export PSEUDO_PREFIX=${PWD} num_tests=0 num_passed_tests=0 +num_skipped_tests=0 +num_failed_tests=0 + +tmplog="$(mktemp pseudo.log.XXXXXXXX)" for file in test/test*.sh do filename=${file#test/} let num_tests++ mkdir -p var/pseudo - ./bin/pseudo $file ${opt_verbose} - if [ "$?" -eq "0" ]; then + ./bin/pseudo $file ${opt_verbose} >${tmplog} 2>&1 + rc=$? + if [ "${opt_verbose}" = "-v" ]; then + echo + cat ${tmplog} + fi + if [ "$rc" -eq "0" ]; then let num_passed_tests++ - if [ "${opt_verbose}" == "-v" ]; then - echo "${filename%.sh}: Passed." - fi + echo "${filename%.sh}: Passed." + elif [ "$rc" -eq "255" ]; then + let num_skipped_tests++ + echo "${filename%.sh}: Skipped." else + let num_failed_tests++ echo "${filename/%.sh}: Failed." fi rm -rf var/pseudo/* done +echo "${num_failed_tests}/${num_tests} test(s) failed." +echo "${num_skipped_tests}/${num_tests} test(s) skipped." echo "${num_passed_tests}/${num_tests} test(s) passed." +rm ${tmplog} diff --git a/test/test-acl.sh b/test/test-acl.sh index fb7d5ec..fa2ed45 100755 --- a/test/test-acl.sh +++ b/test/test-acl.sh @@ -6,11 +6,27 @@ # Return vals: 2 - Unable to run ACL commands, assertion failure # 1 - Invalid return value # 0 - Pass +# 255 - acl programs unavailable, skip # NOTE: these test exclusively test setfacl -m set -u +rc=0 +which getfacl 2>/dev/null +if [ $? -ne 0 ]; then + echo "getfacl command missing" + rc=255 +fi +which setfacl 2>/dev/null +if [ $? -ne 0 ]; then + echo "setfacl command missing" + rc=255 +fi +if [ $rc -ne 0 ]; then + exit $rc +fi + check_owner () { local file="$1" local expected="$2" diff --git a/test/test-xattr.sh b/test/test-xattr.sh index 09cd6b0..6ac6b3c 100755 --- a/test/test-xattr.sh +++ b/test/test-xattr.sh @@ -7,6 +7,23 @@ # 1 - Invalid return value # 0 - Pass +set -u + +rc=0 +which getfattr 2>/dev/null +if [ $? -ne 0 ]; then + echo "getfattr command missing" + rc=255 +fi +which setfattr 2>/dev/null +if [ $? -ne 0 ]; then + echo "setfattr command missing" + rc=255 +fi +if [ $rc -ne 0 ]; then + exit $rc +fi + touch f1 attrs=`getfattr -d f1 | grep -v '^#'` if [ -n "$attrs" ] From patchwork Thu Jan 15 23:43:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CA89D47CB9 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.840.1768520622002595361 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjY2408772; Thu, 15 Jan 2026 17:43:39 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 03/20] test/test-statx.sh: It should be a failure if pseudo prints an error Date: Thu, 15 Jan 2026 17:43:19 -0600 Message-Id: <1768520616-7289-4-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2981 Capture the output and compare to a know error message, error if the null message is present. This is currently a known failure, reported in Yocto Project bug 16075. Signed-off-by: Mark Hatle --- test/test-statx.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test-statx.sh b/test/test-statx.sh index 77d0302..045f6ff 100755 --- a/test/test-statx.sh +++ b/test/test-statx.sh @@ -3,4 +3,16 @@ # SPDX-License-Identifier: LGPL-2.1-only # -exec ./test/test-statx +tmplog="$(mktemp pseudo.log.XXXXXXXX)" +./test/test-statx >${tmplog} 2>&1 +rc=$? + +if grep -q "couldn't allocate absolute path for 'null'." ${tmplog} ; then + echo "Unexpected message: \"couldn't allocate absolute path for 'null'.\" found." + rc=1 +fi + +cat ${tmplog} + +rm $tmplog +exit $rc From patchwork Thu Jan 15 23:43:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78846 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 735FED47CB5 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.839.1768520621951643287 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjZ2408772; Thu, 15 Jan 2026 17:43:39 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 04/20] test-realpath: Verify the realpath behavior matches glibc Date: Thu, 15 Jan 2026 17:43:20 -0600 Message-Id: <1768520616-7289-5-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2980 Gauthier HADERER reported that the realpath implementation could return the wrong value. Create a test-case to attempt to verify realpath behavior. Signed-off-by: Mark Hatle --- test/test-realpath.c | 17 ++++++++++++ test/test-realpath.sh | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 test/test-realpath.c create mode 100755 test/test-realpath.sh diff --git a/test/test-realpath.c b/test/test-realpath.c new file mode 100644 index 0000000..0af92cf --- /dev/null +++ b/test/test-realpath.c @@ -0,0 +1,17 @@ +/* Code contributed by Gauthier HADERER via lists.yoctoproject.org */ + +#include +#include +#include +int main(int argc, char **argv) { + if (argc != 2) + return 2; + char *rpath = realpath(argv[1], NULL); + if (!rpath) { + perror("realpath"); + return 1; + } + printf("%s\n", rpath); + free(rpath); + return 0; +} diff --git a/test/test-realpath.sh b/test/test-realpath.sh new file mode 100755 index 0000000..5b42b57 --- /dev/null +++ b/test/test-realpath.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# SPDX-License-Identifier: LGPL-2.1-only +# +# See Yocto Project bugzilla 16028 +# +# Gauthier HADERER reported differences in realpath behavior +# + +go_exit() { + if [ -n "${link}" ]; then + rm ${link} + fi + + if [ -n "${file}" ]; then + rm ${file} + fi + + exit $rc +} + +mypath=$(dirname $0) + +# Verify that a missing file fails +${mypath}/test-realpath doesnt-exist +rc=$? + +if [ $rc -eq 0 ]; then + echo "Non-zero return code expected!" + rc=1 + go_exit +fi + +# Verify that a regular file passes +file=$(mktemp test-realpath.XXXXXX) + +filepath=$(${mypath}/test-realpath ${file}) +rc=$? + +if [ $rc -ne 0 ]; then + echo "Zero return code expected! Unable to find ${file}." + go_exit +fi + +link=$(mktemp test-realpath.XXXXXX) +rm ${link} +ln -s ${file} ${link} +linkpath=`${mypath}/test-realpath ${link}` +rc=$? +rm ${link} + +rm ${file} + +if [ $rc -ne 0 ]; then + echo "Zero return code expected! Unable to find ${link}." + go_exit +fi + +if [ "${linkpath}" != "${filepath}" ]; then + echo "Link didn't return to expected target!" + rc=1 + go_exit +fi From patchwork Thu Jan 15 23:43:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CA42D47CB8 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.757.1768520622127824037 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbja2408772; Thu, 15 Jan 2026 17:43:39 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 05/20] run_tests.sh: In verbose mode, include pseudo.log in output Date: Thu, 15 Jan 2026 17:43:21 -0600 Message-Id: <1768520616-7289-6-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2982 Signed-off-by: Mark Hatle --- run_tests.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index 3d0920f..1b6cfb9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -46,6 +46,10 @@ do if [ "${opt_verbose}" = "-v" ]; then echo cat ${tmplog} + if [ $rc -ne 0 -a $rc -ne 255 ]; then + # Include the contents of the pseudo.log before we delete it + cat var/pseudo/pseudo.log + fi fi if [ "$rc" -eq "0" ]; then let num_passed_tests++ From patchwork Thu Jan 15 23:43:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78848 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99135D47CBD for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.756.1768520621954725084 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjb2408772; Thu, 15 Jan 2026 17:43:40 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 06/20] test/test-statx: Add uutils test case Date: Thu, 15 Jan 2026 17:43:22 -0600 Message-Id: <1768520616-7289-7-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2978 Signed-off-by: Mark Hatle --- test/test-statx.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/test-statx.sh b/test/test-statx.sh index 045f6ff..feef8e6 100755 --- a/test/test-statx.sh +++ b/test/test-statx.sh @@ -3,6 +3,7 @@ # SPDX-License-Identifier: LGPL-2.1-only # +printf "statx null path: " tmplog="$(mktemp pseudo.log.XXXXXXXX)" ./test/test-statx >${tmplog} 2>&1 rc=$? @@ -10,9 +11,33 @@ rc=$? if grep -q "couldn't allocate absolute path for 'null'." ${tmplog} ; then echo "Unexpected message: \"couldn't allocate absolute path for 'null'.\" found." rc=1 +else + echo "passed" fi cat ${tmplog} rm $tmplog + +printf "uutils date: " +# Try to figure out if we're using rust corutils +if $(date --version 2>&1 | grep -q "uutils") ; then + tmplog="$(mktemp pseudo.log.XXXXXXXX)" + date >${tmplog} 2>&1 + rc=$? + + if grep -q "couldn't allocate absolute path for 'null'." ${tmplog} ; then + echo "Unexpected message: \"couldn't allocate absolute path for 'null'.\" found." + rc=1 + else + echo passed + fi + + cat ${tmplog} + + rm $tmplog +else + echo skipped +fi + exit $rc From patchwork Thu Jan 15 23:43:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73539D47CB4 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.758.1768520622128155955 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjc2408772; Thu, 15 Jan 2026 17:43:40 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 07/20] test/test-nftw: Avoid compile warnings Date: Thu, 15 Jan 2026 17:43:23 -0600 Message-Id: <1768520616-7289-8-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2983 Signed-off-by: Mark Hatle --- test/nftw-test-impl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/nftw-test-impl.c b/test/nftw-test-impl.c index 714da76..8d4c1a8 100644 --- a/test/nftw-test-impl.c +++ b/test/nftw-test-impl.c @@ -41,6 +41,8 @@ char* get_absolute_path(const char* fpath) { } static int callback(const char* fpath, const struct NFTW_STAT_STRUCT *sb, int typeflag, struct FTW *ftwbuf){ + (void) ftwbuf; + if (print_filename) { char* filepath = get_absolute_path(fpath); printf("%s\n", filepath); From patchwork Thu Jan 15 23:43:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39AABD47CA3 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.755.1768520621953833623 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjd2408772; Thu, 15 Jan 2026 17:43:40 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 08/20] test-tclsh-fork: Skip test if tclsh is not available Date: Thu, 15 Jan 2026 17:43:24 -0600 Message-Id: <1768520616-7289-9-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2979 Signed-off-by: Mark Hatle --- test/test-tclsh-fork.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test-tclsh-fork.sh b/test/test-tclsh-fork.sh index e06f36b..cb63a55 100755 --- a/test/test-tclsh-fork.sh +++ b/test/test-tclsh-fork.sh @@ -3,6 +3,11 @@ # SPDX-License-Identifier: LGPL-2.1-only # +which tclsh >/dev/null 2>&1 +if [ $? -ne 0 ]; then + exit 255 +fi + # Check that tclsh doesn't hang. Note that the timeout is not needed to # reproduce the hang in tclsh, it's only there to ensure that this test script # doesn't hang in case of a failing test. From patchwork Thu Jan 15 23:43:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DE2BD47CAE for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.841.1768520622234886550 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbje2408772; Thu, 15 Jan 2026 17:43:40 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 09/20] ports/unix/guts/realpath.c: realpath fails if the resolved path doesn't exist Date: Thu, 15 Jan 2026 17:43:25 -0600 Message-Id: <1768520616-7289-10-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2984 From: Gauthier HADERER The pseudo implementation of `realpath()' may return a path which doesn't exist. This is not POSIX compliant and causes troubles with uutils (coreutils in Rust). For example, the tail commands tries to determine the file path of its standard input file descriptor by calling `realpath("/dev/fd/0")'. When the input is a pipe, the GNU C library returns NULL but pseudo returns `/proc//fd/pipe:[xxxxxx]'. As it got a path, the tail command tries to open it and fails. Contributed-by: Gauthier HADERER via yocto-patches@lists.yoctoproject.org Signed-off-by: Mark Hatle --- ports/unix/guts/realpath.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/unix/guts/realpath.c b/ports/unix/guts/realpath.c index 8d8118b..c13eb93 100644 --- a/ports/unix/guts/realpath.c +++ b/ports/unix/guts/realpath.c @@ -14,6 +14,15 @@ errno = ENAMETOOLONG; return NULL; } + + /* We must fail if the target path doesn't exist. */ + PSEUDO_STATBUF buf; + + if (base_lstat(rname, &buf) == -1) { + errno = EINVAL; + return NULL; + } + len = strlen(rname); char *ep = rname + len - 1; while (ep > rname && *ep == '/') { From patchwork Thu Jan 15 23:43:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68779D47CAF for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.759.1768520622329678687 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjf2408772; Thu, 15 Jan 2026 17:43:40 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 10/20] test/test-proc-pipe.sh: Add test case for proc pipes Date: Thu, 15 Jan 2026 17:43:26 -0600 Message-Id: <1768520616-7289-11-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2985 From: Mark Hatle See: Yocto Project bugzilla 16028, comment #23. This is related to both statx and realpath behavior. Gauthier HADERER (see comment 23) reported an issue where realpath like behavior of pseudo_fix_path function resulted in a failure of the rust based tail command. It was determined that the behavior could be emulated by doing: echo "test" | tail /dev/fd/0 (tail, cat or any other similar command would result in the same failure) This results in: /dev/fd/0 -> /proc/self/fd/0 /proc/self/fd/0 -> /proc/1475524/fd/0 /proc/1475524/fd/0 -> /proc/1475524/fd/pipe:[1177004485] with an eventual failure of unable to open /proc/1475524/fd/pipe:[1177004485] Reported-by: Gauthier HADERER Signed-off-by: Mark Hatle Signed-off-by: Mark Hatle --- test/test-proc-pipe.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/test-proc-pipe.sh diff --git a/test/test-proc-pipe.sh b/test/test-proc-pipe.sh new file mode 100755 index 0000000..30b6880 --- /dev/null +++ b/test/test-proc-pipe.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# +# SPDX-License-Identifier: LGPL-2.1-only +# +# See Yocto Project bugzilla 16028 +# +# It was determined that a utility that use /dev/fd may fail when run under +# pseudo, while working properly outside. +# +# For example: echo "test" | cat /dev/fd/0 + +# Tests +result=$(echo "test" | cat 2>&1) +rc=$? +if [ $rc -ne 0 -o "$result" != "test" ]; then + echo Failed simple echo pipe test - $rc: + echo $result + exit 1 +fi + +result=$(echo "test" | cat /dev/fd/0 2>&1) +rc=$? +if [ $rc -ne 0 -o "$result" != "test" ]; then + echo Failed /dev/fd/0 echo pipe test - $rc: + echo $result + exit 1 +fi From patchwork Thu Jan 15 23:43:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D9F8D47CAD for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.842.1768520622486113618 for ; Thu, 15 Jan 2026 15:43:42 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjg2408772; Thu, 15 Jan 2026 17:43:41 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 11/20] pseudo_util.c: Skip realpath like expansion for /proc on Linux Date: Thu, 15 Jan 2026 17:43:27 -0600 Message-Id: <1768520616-7289-12-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2986 From: Mark Hatle See: Yocto Project bugzilla 16028 Gauthier HADERER (see comment 23) reported an issue where realpath like behavior of pseudo_fix_path function resulted in a failure of the rust based tail command. It was determined that the behavior could be emulated by doing: echo "test" | tail /dev/fd/0 (tail, cat or any other similar command would result in the same failure) This results in: /dev/fd/0 -> /proc/self/fd/0 /proc/self/fd/0 -> /proc/1475524/fd/0 /proc/1475524/fd/0 -> /proc/1475524/fd/pipe:[1177004485] with an eventual failure of unable to open /proc/1475524/fd/pipe:[1177004485] This change resolves the issue by detecting the path has been resolved into the /proc filesystem and then check link targets until it finds one that does not resolve. It stops at that points. This ensures that special /proc behavior can be maintained. In the /proc filesystem, on Linux, paths can be opened even if they can't be stated. The 'pipe' appears to be one of these special files, so using lstat to check if it can be opened is an easy way to determine if we have stumbled onto one of these special files. Reported-by: Gauthier HADERER Signed-off-by: Mark Hatle Signed-off-by: Mark Hatle --- pseudo_util.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/pseudo_util.c b/pseudo_util.c index a94a4da..d16b14c 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -614,12 +614,40 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre size_t curlen; int is_dir = S_ISDIR(buf->st_mode); char *current; +#ifdef PSEUDO_PORT_LINUX + int is_proc = 0; + char *proc_path = NULL; +#endif if (!newpath || !pcurrent || !*pcurrent || !root || !element) { pseudo_diag("pseudo_append_element: invalid args.\n"); return -1; } + +#ifdef PSEUDO_PORT_LINUX + /* If we end up resolving a path into /proc, it has special meaning. + * For instance, /dev/fd/0 -> /proc/self/fd/0 -> + * /proc/1475524/fd/0 -> /proc/1475524/fd/pipe:[1177004485] + * Trying to access the resolved name "pipe:[....]" may fail. + * + * We verify each link target and only expand if it exists. + */ + if (strncmp(newpath, "/proc/", 6) == 0) { + pseudo_debug(PDBGF_PATH | PDBGF_VERBOSE, "paes: %s in /proc\n", + newpath ? newpath : ""); + /* Store off the path for later */ + proc_path = strdup(newpath); + /* If memory can't be allocated for newpath, + * fall through and do standard processing + */ + if (!proc_path) + pseudo_diag("allocation failed seeking memory for path (%s).\n", newpath); + else + is_proc = 1; + } +#endif + current = *pcurrent; pseudo_debug(PDBGF_PATH | PDBGF_VERBOSE, "pae: '%s', + '%.*s', is_dir %d\n", newpath, (int) elen, element, is_dir); @@ -700,6 +728,33 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre if (*linkbuf == '/') { current = root; } else { +#ifdef PSEUDO_PORT_LINUX + if (is_proc) { + /* Check that the link target exists, otherwise stop resolving since /proc is special! */ + PSEUDO_STATBUF statbuf; + + size_t target_link_max = pseudo_path_max(); + char *target_link_path = malloc(pseudo_path_max()); + + if (!target_link_path) + pseudo_diag("allocation failed seeking memory for path (%s/%s).\n", proc_path, linkbuf); + /* Fall through, nothing we can do here */ + else { + snprintf(target_link_path, target_link_max, "%s/%s", proc_path, linkbuf); + + if (!pseudo_real_lstat || (pseudo_real_lstat(target_link_path, &statbuf) == -1)) { + pseudo_debug(PDBGF_PATH, "proc link (%s) target (%s) does not exist, skipping.\n", newpath, target_link_path); + free(target_link_path); + free(proc_path); + *pcurrent = current; + return 1; + } else + pseudo_debug(PDBGF_PATH, "proc link (%s) target (%s) exists.\n", newpath, target_link_path); + + free(target_link_path); + } + } +#endif /* point back at the end of the previous path... */ current -= (elen + 1); } @@ -716,13 +771,26 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre ++link_recursion; retval = pseudo_append_elements(newpath, root, allocated, pcurrent, linkbuf, linklen, 0, buf); --link_recursion; + +#ifdef PSEUDO_PORT_LINUX + if (is_proc) + free(proc_path); +#endif + return retval; } } + /* we used to always append a slash here. now we don't; append_elements * handles slashes, so just update the pointer. */ *pcurrent = current; + +#ifdef PSEUDO_PORT_LINUX + /* We must not have used this to get here... */ + if (is_proc) + free(proc_path); +#endif return 1; } From patchwork Thu Jan 15 23:43:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16672D3CCB0 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.848.1768520625174329076 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjh2408772; Thu, 15 Jan 2026 17:43:41 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 12/20] ports/unix/guts/realpath.c: Fix indents Date: Thu, 15 Jan 2026 17:43:28 -0600 Message-Id: <1768520616-7289-13-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2995 Signed-off-by: Mark Hatle --- ports/unix/guts/realpath.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/unix/guts/realpath.c b/ports/unix/guts/realpath.c index c13eb93..62a92b2 100644 --- a/ports/unix/guts/realpath.c +++ b/ports/unix/guts/realpath.c @@ -23,14 +23,14 @@ return NULL; } - len = strlen(rname); - char *ep = rname + len - 1; - while (ep > rname && *ep == '/') { - --len; - *(ep--) = '\0'; - } + len = strlen(rname); + char *ep = rname + len - 1; + while (ep > rname && *ep == '/') { + --len; + *(ep--) = '\0'; + } - if (len >= pseudo_sys_path_max()) { + if (len >= pseudo_sys_path_max()) { errno = ENAMETOOLONG; return NULL; } From patchwork Thu Jan 15 23:43:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21011D3CCBE for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.766.1768520625113444897 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbji2408772; Thu, 15 Jan 2026 17:43:41 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations Date: Thu, 15 Jan 2026 17:43:29 -0600 Message-Id: <1768520616-7289-14-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2993 The seccomp wrap always takes effect when pseudo is running, this will prevent various behavior, even if pseudo is generally considered to be disabled, but in memory. The openat2 and renameat2 however should only run if pseudo is enabled. Signed-off-by: Mark Hatle --- ports/linux/pseudo_wrappers.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/ports/linux/pseudo_wrappers.c b/ports/linux/pseudo_wrappers.c index 6b54083..b486c34 100644 --- a/ports/linux/pseudo_wrappers.c +++ b/ports/linux/pseudo_wrappers.c @@ -65,19 +65,6 @@ syscall(long number, ...) { return rc; } -#ifdef SYS_renameat2 - /* concerns exist about trying to parse arguments because syscall(2) - * specifies strange ABI behaviors. If we can get better clarity on - * that, it could make sense to redirect to wrap_renameat2(). - */ - if (number == SYS_renameat2) { - errno = ENOSYS; - return -1; - } -#else - (void) number; -#endif - #ifdef SYS_seccomp /* pseudo and seccomp are incompatible as pseudo uses different syscalls * so pretend to enable seccomp but really do nothing */ @@ -92,6 +79,10 @@ syscall(long number, ...) { } #endif + if (pseudo_disabled) { + goto call_syscall; + } + #ifdef SYS_openat2 /* concerns exist about trying to parse arguments because syscall(2) * specifies strange ABI behaviors. If we can get better clarity on @@ -105,6 +96,18 @@ syscall(long number, ...) { } #endif +#ifdef SYS_renameat2 + /* concerns exist about trying to parse arguments because syscall(2) + * specifies strange ABI behaviors. If we can get better clarity on + * that, it could make sense to redirect to wrap_renameat2(). + */ + if (number == SYS_renameat2) { + errno = ENOSYS; + return -1; + } +#endif + +call_syscall: /* gcc magic to attempt to just pass these args to syscall. we have to * guess about the number of args; the docs discuss calling conventions * up to 7, so let's try that? From patchwork Thu Jan 15 23:43:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E390D44C4E for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.765.1768520625112525947 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjj2408772; Thu, 15 Jan 2026 17:43:41 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 14/20] ports/linux/pseudo_wrappers.c: Call the wrappers where possible Date: Thu, 15 Jan 2026 17:43:30 -0600 Message-Id: <1768520616-7289-15-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2992 Using va args, call the wrapper when the syscall is invoked. This will allow us to implement the renameat2 and openat2 functions in the future while keeping the syscall work unchanged. The syscall -> wrappers should continue to be sparse into things we know are outliers, as this could result in some maintenance work keeping the argument processing sane. Signed-off-by: Mark Hatle --- ports/linux/pseudo_wrappers.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ports/linux/pseudo_wrappers.c b/ports/linux/pseudo_wrappers.c index b486c34..7c025ae 100644 --- a/ports/linux/pseudo_wrappers.c +++ b/ports/linux/pseudo_wrappers.c @@ -84,26 +84,31 @@ syscall(long number, ...) { } #ifdef SYS_openat2 - /* concerns exist about trying to parse arguments because syscall(2) - * specifies strange ABI behaviors. If we can get better clarity on - * that, it could make sense to redirect to wrap_openat2(). - * There is a CVE patch (CVE-2025-45582) to tar 1.34 in Centos Stream which + /* There is a CVE patch (CVE-2025-45582) to tar 1.34 in Centos Stream which * uses syscall to access openat2() and breaks builds if we don't redirect. */ if (number == SYS_openat2) { - errno = ENOSYS; - return -1; + va_start(ap, number); + int dirfd = va_arg(ap, int); + const char * path = va_arg(ap, const char *); + void *how = va_arg(ap, void *); + size_t size = va_arg(ap, size_t); + + return wrap_openat2(dirfd, path, how, size); } #endif #ifdef SYS_renameat2 - /* concerns exist about trying to parse arguments because syscall(2) - * specifies strange ABI behaviors. If we can get better clarity on - * that, it could make sense to redirect to wrap_renameat2(). - */ + /* Call out wrapper, expanding the variable arguments first */ if (number == SYS_renameat2) { - errno = ENOSYS; - return -1; + va_start(ap, number); + int olddirfd = va_arg(ap, int); + const char * oldpath = va_arg(ap, const char *); + int newdirfd = va_arg(ap, int); + const char * newpath = va_arg(ap, const char *); + unsigned int flags = va_arg(ap, unsigned int); + + return wrap_renameat2(olddirfd, oldpath, newdirfd, newpath, flags); } #endif From patchwork Thu Jan 15 23:43:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5261DD47CAA for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.762.1768520624110854572 for ; Thu, 15 Jan 2026 15:43:44 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjk2408772; Thu, 15 Jan 2026 17:43:42 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions Date: Thu, 15 Jan 2026 17:43:31 -0600 Message-Id: <1768520616-7289-16-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2987 Note, other functions claim to return EFAULT when the path element is NULL, however glibc has these parameters tagged as non-null which optimizes out any sort of NULL test by default. Due to this only items that don't error were included. Signed-off-by: Mark Hatle --- ports/linux/openat2/wrapfuncs.in | 2 +- ports/linux/wrapfuncs.in | 22 +++++++++++----------- ports/linux/xattr/wrapfuncs.in | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ports/linux/openat2/wrapfuncs.in b/ports/linux/openat2/wrapfuncs.in index 96ae8a7..419813f 100644 --- a/ports/linux/openat2/wrapfuncs.in +++ b/ports/linux/openat2/wrapfuncs.in @@ -1 +1 @@ -int openat2(int dirfd, const char *path, struct open_how *how, size_t size); +int openat2(int dirfd, const char *path, struct open_how *how, size_t size); /* efault=path */ diff --git a/ports/linux/wrapfuncs.in b/ports/linux/wrapfuncs.in index 234a13c..7a2e9f0 100644 --- a/ports/linux/wrapfuncs.in +++ b/ports/linux/wrapfuncs.in @@ -1,17 +1,17 @@ int open(const char *path, int flags, ...{mode_t mode}); /* flags=((flags&O_NOFOLLOW)||((flags&(O_CREAT|O_EXCL))==(O_CREAT|O_EXCL))), noignore_path=1 */ char *get_current_dir_name(void); -int __xstat(int ver, const char *path, struct stat *buf); -int __lxstat(int ver, const char *path, struct stat *buf); /* flags=AT_SYMLINK_NOFOLLOW */ +int __xstat(int ver, const char *path, struct stat *buf); /* efault=path */ +int __lxstat(int ver, const char *path, struct stat *buf); /* flags=AT_SYMLINK_NOFOLLOW, efault=path */ int __fxstat(int ver, int fd, struct stat *buf); int lchmod(const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */ int lchown(const char *path, uid_t owner, gid_t group); /* flags=AT_SYMLINK_NOFOLLOW */ -int __fxstatat(int ver, int dirfd, const char *path, struct stat *buf, int flags); +int __fxstatat(int ver, int dirfd, const char *path, struct stat *buf, int flags); /* efault=path */ int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=((flags&O_NOFOLLOW)||((flags&(O_CREAT|O_EXCL))==(O_CREAT|O_EXCL))), noignore_path=1 */ int __openat_2(int dirfd, const char *path, int flags); /* flags=((flags&O_NOFOLLOW)||((flags&(O_CREAT|O_EXCL))==(O_CREAT|O_EXCL))), noignore_path=1 */ int mknod(const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknod */ int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknodat */ -int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW */ -int __xmknodat(int ver, int dirfd, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW */ +int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW, efault=path */ +int __xmknodat(int ver, int dirfd, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW, efault=path */ int fcntl(int fd, int cmd, ...{struct flock *lock}); /* noignore_path=1 */ int fcntl64(int fd, int cmd, ...{struct flock *lock}); /* noignore_path=1 */ # just so we know the inums of symlinks @@ -24,15 +24,15 @@ int creat64(const char *path, mode_t mode); int stat(const char *path, struct stat *buf); /* real_func=pseudo_stat */ int lstat(const char *path, struct stat *buf); /* real_func=pseudo_lstat, flags=AT_SYMLINK_NOFOLLOW */ int fstat(int fd, struct stat *buf); /* real_func=pseudo_fstat */ -int fstatat(int dirfd, const char *path, struct stat *buf, int flags); +int fstatat(int dirfd, const char *path, struct stat *buf, int flags); /* efault=path */ int stat64(const char *path, struct stat64 *buf); /* real_func=pseudo_stat64 */ int lstat64(const char *path, struct stat64 *buf); /* real_func=pseudo_lstat64, flags=AT_SYMLINK_NOFOLLOW */ int fstat64(int fd, struct stat64 *buf); /* real_func=pseudo_fstat64 */ -int fstatat64(int dirfd, const char *path, struct stat64 *buf, int flags); -int __xstat64(int ver, const char *path, struct stat64 *buf); -int __lxstat64(int ver, const char *path, struct stat64 *buf); /* flags=AT_SYMLINK_NOFOLLOW */ +int fstatat64(int dirfd, const char *path, struct stat64 *buf, int flags); /* efault=path */ +int __xstat64(int ver, const char *path, struct stat64 *buf); /* efault=path */ +int __lxstat64(int ver, const char *path, struct stat64 *buf); /* flags=AT_SYMLINK_NOFOLLOW, efault=path */ int __fxstat64(int ver, int fd, struct stat64 *buf); -int __fxstatat64(int ver, int dirfd, const char *path, struct stat64 *buf, int flags); +int __fxstatat64(int ver, int dirfd, const char *path, struct stat64 *buf, int flags); /* efault=path */ FILE *fopen64(const char *path, const char *mode); /* noignore_path=1 */ int nftw64(const char *path, int (*fn)(const char *, const struct stat64 *, int, struct FTW *), int nopenfd, int flag); /* noignore_path=1 */ FILE *freopen64(const char *path, const char *mode, FILE *stream); /* noignore_path=1 */ @@ -61,7 +61,7 @@ int getpwent_r(struct passwd *pwbuf, char *buf, size_t buflen, struct passwd **p int getgrent_r(struct group *gbuf, char *buf, size_t buflen, struct group **gbufp); int capset(cap_user_header_t hdrp, const cap_user_data_t datap); /* real_func=pseudo_capset */ long syscall(long nr, ...); /* hand_wrapped=1 */ -int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags); /* flags=AT_SYMLINK_NOFOLLOW */ +int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags); /* flags=AT_SYMLINK_NOFOLLOW, efault=oldpath|newpath */ int prctl(int option, ...); /* hand_wrapped=1 */ int close_range(unsigned int lowfd, unsigned int maxfd, int flags); void closefrom(int fd); diff --git a/ports/linux/xattr/wrapfuncs.in b/ports/linux/xattr/wrapfuncs.in index 09eba23..e8045b9 100644 --- a/ports/linux/xattr/wrapfuncs.in +++ b/ports/linux/xattr/wrapfuncs.in @@ -1,12 +1,12 @@ -ssize_t getxattr(const char *path, const char *name, void *value, size_t size); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ +ssize_t getxattr(const char *path, const char *name, void *value, size_t size); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ +ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size); /* version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -int setxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -int lsetxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ +int setxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ +int lsetxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ int fsetxattr(int filedes, const char *name, const void *value, size_t size, int xflags); /* version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -ssize_t listxattr(const char *path, char *list, size_t size); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -ssize_t llistxattr(const char *path, char *list, size_t size); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ +ssize_t listxattr(const char *path, char *list, size_t size); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ +ssize_t llistxattr(const char *path, char *list, size_t size); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ ssize_t flistxattr(int filedes, char *list, size_t size); /* version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -int removexattr(const char *path, const char *name); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ -int lremovexattr(const char *path, const char *name); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ +int removexattr(const char *path, const char *name); /* flags=0, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ +int lremovexattr(const char *path, const char *name); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3", version-aarch64="GLIBC_2.17", efault=path */ int fremovexattr(int filedes, const char *name); /* version="GLIBC_2.3", version-aarch64="GLIBC_2.17" */ From patchwork Thu Jan 15 23:43:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A949D47CA5 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.764.1768520625058314019 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjl2408772; Thu, 15 Jan 2026 17:43:42 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 16/20] Update COPYRIGHT files Date: Thu, 15 Jan 2026 17:43:32 -0600 Message-Id: <1768520616-7289-17-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2991 From: Mark Hatle Signed-off-by: Mark Hatle --- guts/COPYRIGHT | 2 ++ ports/darwin/guts/COPYRIGHT | 1 + ports/linux/guts/COPYRIGHT | 2 ++ ports/uids_generic/guts/COPYRIGHT | 1 + ports/unix/guts/COPYRIGHT | 2 ++ 5 files changed, 8 insertions(+) diff --git a/guts/COPYRIGHT b/guts/COPYRIGHT index 1b478d1..db589b4 100644 --- a/guts/COPYRIGHT +++ b/guts/COPYRIGHT @@ -1,5 +1,7 @@ /* * Copyright (c) 2008-2014 Wind River Systems, Inc. + * Copyright (c) 2018 Peter Seebach/Seebs + * Copyright (c) 2020-2026 Yocto Project Contributors * * SPDX-License-Identifier: LGPL-2.1-only * diff --git a/ports/darwin/guts/COPYRIGHT b/ports/darwin/guts/COPYRIGHT index b860a36..6cbbc41 100644 --- a/ports/darwin/guts/COPYRIGHT +++ b/ports/darwin/guts/COPYRIGHT @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2010 Wind River Systems, Inc. + * Copyright (c) 2018 Peter Seebach/Seebs * * SPDX-License-Identifier: LGPL-2.1-only * diff --git a/ports/linux/guts/COPYRIGHT b/ports/linux/guts/COPYRIGHT index b860a36..1c33800 100644 --- a/ports/linux/guts/COPYRIGHT +++ b/ports/linux/guts/COPYRIGHT @@ -1,5 +1,7 @@ /* * Copyright (c) 2008-2010 Wind River Systems, Inc. + * Copyright (c) 2018-2019 Peter Seebach/Seebs + * Copyright (c) 2019-2026 Yocto Project Contributors * * SPDX-License-Identifier: LGPL-2.1-only * diff --git a/ports/uids_generic/guts/COPYRIGHT b/ports/uids_generic/guts/COPYRIGHT index b860a36..6cbbc41 100644 --- a/ports/uids_generic/guts/COPYRIGHT +++ b/ports/uids_generic/guts/COPYRIGHT @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2010 Wind River Systems, Inc. + * Copyright (c) 2018 Peter Seebach/Seebs * * SPDX-License-Identifier: LGPL-2.1-only * diff --git a/ports/unix/guts/COPYRIGHT b/ports/unix/guts/COPYRIGHT index b860a36..79da56d 100644 --- a/ports/unix/guts/COPYRIGHT +++ b/ports/unix/guts/COPYRIGHT @@ -1,5 +1,7 @@ /* * Copyright (c) 2008-2010 Wind River Systems, Inc. + * Copyright (c) 2018 Peter Seebach/Seebs + * Copyright (C) 2020-2026 Yocto Project Contributors * * SPDX-License-Identifier: LGPL-2.1-only * From patchwork Thu Jan 15 23:43:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48AFCD47CA7 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.846.1768520625026140749 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjm2408772; Thu, 15 Jan 2026 17:43:42 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 17/20] makewrappers: improve error handling and robustness Date: Thu, 15 Jan 2026 17:43:33 -0600 Message-Id: <1768520616-7289-18-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2989 From: Mark Hatle Add several robustness improvements to the makewrappers Python script: * Add null checks for self.type and arg.name to prevent AttributeError when processing malformed function declarations * Add validation for comment format to ensure '=' is present before attempting to parse comments into dictionaries * Replace incorrect poll() calls with returncode attribute when checking subprocess completion status * Add proper file error handling with context managers (with statements) and OSError exceptions when reading/writing wrapper files * Add argument validation to ensure wrapper function arguments are properly specified before generating code These changes prevent crashes when processing invalid input and improve error reporting when file operations fail. AI-Generated: Suggested by GitHub Copilot (Claude Sonnet 4.5) Signed-off-by: Mark Hatle --- makewrappers | 73 ++++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/makewrappers b/makewrappers index c9f6ad5..326f70e 100755 --- a/makewrappers +++ b/makewrappers @@ -12,7 +12,6 @@ import sys import re import os.path import platform -import string import subprocess from templatefile import TemplateFile @@ -152,9 +151,11 @@ class Argument: # spacing between type and name, needed if type ends with a character # which could be part of an identifier - if re.match('[_a-zA-Z0-9]', self.type[-1]): + if self.type and re.match('[_a-zA-Z0-9]', self.type[-1]): self.spacer = ' ' + return + def decl(self, comment=False, wrap=False): """Produce the declaration form of this argument.""" if self.function_pointer: @@ -274,13 +275,13 @@ class Function: # ignore varargs, they never get these special treatments if arg.vararg: pass - elif arg.name.endswith('dirfd'): + elif arg.name and arg.name.endswith('dirfd'): if len(arg.name) > 5: self.specific_dirfds[arg.name[:-5]] = True self.dirfd = 'dirfd' elif arg.name == 'flags': self.flags = '(flags & AT_SYMLINK_NOFOLLOW)' - elif arg.name.endswith('path'): + elif arg.name and arg.name.endswith('path'): self.paths_to_munge.append(arg.name) elif arg.name == 'fd': self.fd_arg = "fd" @@ -304,6 +305,10 @@ class Function: # handle special comments, such as flags=AT_SYMLINK_NOFOLLOW if self.comments: comments = self.comments.replace('==','') + # Validate the comments + for mod in comments.split(','): + if '=' not in mod: + raise Exception("Parse error invalid comment '%s'" % (comments)) # Build a dictionary of key=value, key=value pairs modifiers = dict(mod.split("=") for mod in comments.split(',')) # Strip all leading/trailing whitespace @@ -535,7 +540,8 @@ additional ports to include. if os.path.exists(self.portfile("preports")): subport_proc = subprocess.Popen([self.portfile("preports"), self.name], stdout=subprocess.PIPE) portlist = subport_proc.communicate()[0] - retcode = subport_proc.poll() + portlist = portlist.decode("utf-8") + retcode = subport_proc.returncode if retcode: raise Exception("preports script failed for port %s" % self.name) @@ -546,7 +552,8 @@ additional ports to include. if os.path.exists(self.portfile("subports")): subport_proc = subprocess.Popen([self.portfile("subports"), self.name], stdout=subprocess.PIPE) portlist = subport_proc.communicate()[0] - retcode = subport_proc.poll() + portlist = portlist.decode("utf-8") + retcode = subport_proc.returncode if retcode: raise Exception("subports script failed for port %s" % self.name) @@ -622,20 +629,23 @@ def process_wrapfuncs(port): funcs = {} directory = os.path.dirname(filename) sys.stdout.write("%s: " % filename) - funclist = open(filename) - for line in funclist: - line = line.rstrip() - if line.startswith('#') or not line: - continue - try: - func = Function(port, line) - func.directory = directory - funcs[func.name] = func - sys.stdout.write(".") - except Exception as e: - print("Parsing failed:", e) - exit(1) - funclist.close() + try: + with open(filename, "r") as funclist: + for line in funclist: + line = line.rstrip() + if line.startswith('#') or not line: + continue + try: + func = Function(port, line) + func.directory = directory + funcs[func.name] = func + sys.stdout.write(".") + except Exception as e: + print("Parsing failed:", e) + exit(1) + except OSError as e: + print("Unable to open file %s" % filename) + exit(1) print("") return funcs @@ -645,13 +655,19 @@ def main(argv): sources = [] for arg in argv: + if '=' not in arg: + print("Invalid argument '%s', must be of the form name=value" % arg) + exit(1) name, value = arg.split('=') os.environ["port_" + name] = value # error checking helpfully provided by the exception handler - copyright_file = open('guts/COPYRIGHT') - TemplateFile.copyright = copyright_file.read() - copyright_file.close() + try: + with open('guts/COPYRIGHT') as copyright_file: + TemplateFile.copyright = copyright_file.read() + except OSError as e: + print("Unable to open file guts/COPYRIGHT") + exit(1) for path in glob.glob('templates/*'): try: @@ -665,16 +681,7 @@ def main(argv): print("Invalid or malformed template %s. Aborting." % path) exit(1) - try: - port = Port('common', sources) - - except KeyError: - print("Unknown uname -s result: '%s'." % uname_s) - print("Known system types are:") - print("%-20s %-10s %s" % ("uname -s", "port name", "description")) - for key in host_ports: - print("%-20s %-10s %s" % (key, host_ports[key], - host_descrs[host_ports[key]])) + port = Port('common', sources) # the per-function stuff print("Writing functions...") From patchwork Thu Jan 15 23:43:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21118D44C47 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.847.1768520625144321119 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjn2408772; Thu, 15 Jan 2026 17:43:42 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 18/20] pseudo: code quality scan - resolved various potential issues Date: Thu, 15 Jan 2026 17:43:34 -0600 Message-Id: <1768520616-7289-19-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2994 From: Mark Hatle Memory Management Issues: * Unchecked malloc/realloc calls in multiple files that could lead to NULL pointer dereferences or memory leaks * Missing error handling for strdup() calls returning NULL AI-Generated: Issues identified by GitHub Copilot (Claude Sonnet 4.5) The actual code changes however are my own, AI only identified potential issues. Signed-off-by: Mark Hatle --- ports/unix/guts/fts_open.c | 5 ++- ports/unix/guts/nftw_wrapper_base.c | 11 ++--- pseudo.c | 61 ++++++++++++++++----------- pseudo_client.c | 4 ++ pseudo_db.c | 10 +++++ pseudo_server.c | 14 +++++++ pseudo_util.c | 64 +++++++++++++++++++---------- 7 files changed, 117 insertions(+), 52 deletions(-) diff --git a/ports/unix/guts/fts_open.c b/ports/unix/guts/fts_open.c index e5b27ba..ccc9322 100644 --- a/ports/unix/guts/fts_open.c +++ b/ports/unix/guts/fts_open.c @@ -31,8 +31,11 @@ rpath_argv[i] = PSEUDO_ROOT_PATH(AT_FDCWD, path_argv[i], AT_SYMLINK_NOFOLLOW); if (!rpath_argv[i]) errored = 1; - else + else { rpath_argv[i] = strdup(rpath_argv[i]); + if (!rpath_argv[i]) + errored = 1; + } } if (errored) { diff --git a/ports/unix/guts/nftw_wrapper_base.c b/ports/unix/guts/nftw_wrapper_base.c index 76a2ba6..000fa18 100644 --- a/ports/unix/guts/nftw_wrapper_base.c +++ b/ports/unix/guts/nftw_wrapper_base.c @@ -38,7 +38,8 @@ static pthread_mutex_t NFTW_MUTEX_NAME = PTHREAD_MUTEX_INITIALIZER; static void NFTW_APPEND_FN_NAME(struct NFTW_STORAGE_STRUCT_NAME *data_to_append){ NFTW_STORAGE_ARRAY_NAME = realloc(NFTW_STORAGE_ARRAY_NAME, ++NFTW_STORAGE_ARRAY_SIZE * sizeof(*data_to_append)); - memcpy(&NFTW_STORAGE_ARRAY_NAME[NFTW_STORAGE_ARRAY_SIZE - 1], data_to_append, sizeof(*data_to_append)); + if (NFTW_STORAGE_ARRAY_NAME) + memcpy(&NFTW_STORAGE_ARRAY_NAME[NFTW_STORAGE_ARRAY_SIZE - 1], data_to_append, sizeof(*data_to_append)); } int NFTW_FIND_FN_NAME(struct NFTW_STORAGE_STRUCT_NAME* target) { @@ -46,7 +47,7 @@ int NFTW_FIND_FN_NAME(struct NFTW_STORAGE_STRUCT_NAME* target) { // return the last one, not the first for (ssize_t i = NFTW_STORAGE_ARRAY_SIZE - 1; i >= 0; --i){ - if (NFTW_STORAGE_ARRAY_NAME[i].tid == tid){ + if ((NFTW_STORAGE_ARRAY_NAME) && (NFTW_STORAGE_ARRAY_NAME[i].tid == tid)){ // need to dereference it, as next time this array // may be realloc'd, making the original pointer // invalid @@ -62,7 +63,7 @@ static void NFTW_DELETE_FN_NAME() { pthread_t tid = pthread_self(); if (NFTW_STORAGE_ARRAY_SIZE == 1) { - if (NFTW_STORAGE_ARRAY_NAME[0].tid == tid) { + if ((NFTW_STORAGE_ARRAY_NAME) && (NFTW_STORAGE_ARRAY_NAME[0].tid == tid)) { free(NFTW_STORAGE_ARRAY_NAME); NFTW_STORAGE_ARRAY_NAME = NULL; --NFTW_STORAGE_ARRAY_SIZE; @@ -73,7 +74,7 @@ static void NFTW_DELETE_FN_NAME() { } int found_idx = -1; - for (ssize_t i = NFTW_STORAGE_ARRAY_SIZE - 1; i >= 0; --i) { + for (ssize_t i = NFTW_STORAGE_ARRAY_SIZE - 1; (NFTW_STORAGE_ARRAY_NAME) && i >= 0; --i) { if (NFTW_STORAGE_ARRAY_NAME[i].tid == tid) { found_idx = i; break; @@ -86,7 +87,7 @@ static void NFTW_DELETE_FN_NAME() { } // delete the item we just found - for (size_t i = found_idx + 1; i < NFTW_STORAGE_ARRAY_SIZE; ++i) + for (size_t i = found_idx + 1; (NFTW_STORAGE_ARRAY_NAME) && i < NFTW_STORAGE_ARRAY_SIZE; ++i) NFTW_STORAGE_ARRAY_NAME[i - 1] = NFTW_STORAGE_ARRAY_NAME[i]; NFTW_STORAGE_ARRAY_NAME = realloc(NFTW_STORAGE_ARRAY_NAME, --NFTW_STORAGE_ARRAY_SIZE * sizeof(struct NFTW_STORAGE_STRUCT_NAME)); diff --git a/pseudo.c b/pseudo.c index 132d24a..25711b6 100644 --- a/pseudo.c +++ b/pseudo.c @@ -373,8 +373,11 @@ main(int argc, char *argv[]) { while (*path) { struct stat buf; int len = strcspn(path, ":"); - snprintf(fullpath, pseudo_path_max(), "%.*s/%s", - len, path, argv[0]); + if ( snprintf(fullpath, pseudo_path_max(), "%.*s/%s", + len, path, argv[0]) > (int) pseudo_path_max()) { + pseudo_diag("pseudo: path too long.\n"); + exit(EXIT_FAILURE); + } path += len; if (*path == ':') ++path; @@ -394,27 +397,33 @@ main(int argc, char *argv[]) { pseudo_setupenv(); rc = fork(); - if (rc) { - waitpid(rc, &rc, 0); - /* try to hint that we don't think we still need - * the server. - */ - if (opt_S) { - pseudo_client_shutdown(1); - } - if (WIFEXITED(rc)) { - return WEXITSTATUS(rc); - } else if (WIFSIGNALED(rc)) { - kill(getpid(), WTERMSIG(rc)); - exit(1); - } else { - exit(1); - } + if (rc == -1) { + pseudo_diag("pseudo: fork failed: %s\n", + strerror(errno)); + exit(EXIT_FAILURE); } else { - rc = execv(fullpath, argv); - if (rc == -1) { - pseudo_diag("pseudo: can't run %s: %s\n", - argv[0], strerror(errno)); + if (rc) { + waitpid(rc, &rc, 0); + /* try to hint that we don't think we still need + * the server. + */ + if (opt_S) { + pseudo_client_shutdown(1); + } + if (WIFEXITED(rc)) { + return WEXITSTATUS(rc); + } else if (WIFSIGNALED(rc)) { + kill(getpid(), WTERMSIG(rc)); + exit(1); + } else { + exit(1); + } + } else { + rc = execv(fullpath, argv); + if (rc == -1) { + pseudo_diag("pseudo: can't run %s: %s\n", + argv[0], strerror(errno)); + } } exit(EXIT_FAILURE); } @@ -482,15 +491,19 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon /* for rename, the path name would be null-terminated, * but for *xattr, we don't want the null. */ oldpathlen = msg->pathlen - (oldpath - msg->path) - 1; - pseudo_debug(PDBGF_OP | PDBGF_FILE | PDBGF_XATTR, "%s: path '%s', oldpath '%s' [%d/%d]\n", - pseudo_op_name(msg->op), msg->path, oldpath, (int) oldpathlen, (int) msg->pathlen); + /* For a rename op, we want to strip any trailing * slashes. For xattr, "oldpath" is the raw data * to be stored. */ if (oldpathlen > 0 && msg->op == OP_RENAME) { + pseudo_debug(PDBGF_OP | PDBGF_FILE | PDBGF_XATTR, "%s: path '%s', oldpath '%s' [%d/%d]\n", + pseudo_op_name(msg->op), msg->path, oldpath, (int) oldpathlen, (int) msg->pathlen); if (oldpath[oldpathlen - 1] == '/') { oldpath[--oldpathlen] = '\0'; } + } else { + pseudo_debug(PDBGF_OP | PDBGF_FILE | PDBGF_XATTR, "%s: path '%s', xattr data len %d [%d]\n", + pseudo_op_name(msg->op), msg->path, (int) oldpathlen, (int) msg->pathlen); } /* if we got an oldpath, but a 0-length initial * path, we don't want to act as though we had diff --git a/pseudo_client.c b/pseudo_client.c index 8a07341..7041366 100644 --- a/pseudo_client.c +++ b/pseudo_client.c @@ -900,6 +900,10 @@ pseudo_client_path_set(int fd, const char *path, char ***patharray, int *len) { pseudo_debug(PDBGF_CLIENT, "expanding fds from %d to %d\n", *len, fd + 1); (*patharray) = realloc((*patharray), (fd + 1) * sizeof(char *)); + if (!*patharray) { + pseudo_diag("couldn't realloc fd path array to %ld entries\n", (fd + 1) * sizeof(char *)); + exit(1); + } for (i = *len; i < fd + 1; ++i) (*patharray)[i] = 0; *len = fd + 1; diff --git a/pseudo_db.c b/pseudo_db.c index 8b23938..009ea2f 100644 --- a/pseudo_db.c +++ b/pseudo_db.c @@ -2165,6 +2165,10 @@ pdb_update_inode(pseudo_msg_t *msg) { if (!oldmsg) { oldmsg = malloc(sizeof(*msg) + pseudo_path_max()); + if (!oldmsg) { + pseudo_diag("%s: out of memory\n", __func__); + return 1; + } } char *sql = "UPDATE files " @@ -2516,6 +2520,12 @@ pdb_get_xattr(pseudo_msg_t *msg, char **value, size_t *len) { * arbitrary bytes. */ *value = malloc(length); + if (!*value) { + pseudo_diag("%s: out of memory\n", __func__); + sqlite3_reset(select); + sqlite3_clear_bindings(select); + return 1; + } memcpy(*value, response, length); *len = length; rc = 0; diff --git a/pseudo_server.c b/pseudo_server.c index 815c76b..edfbce1 100644 --- a/pseudo_server.c +++ b/pseudo_server.c @@ -558,6 +558,12 @@ serve_client(int i) { char *s; response_path = malloc(8 * active_clients); + if (!response_path) { + pseudo_diag("out of memory allocating shutdown response\n"); + exit(PSEUDO_EXIT_GENERAL); + } else { + memset(response_path, 0, 8 * active_clients); + } in->type = PSEUDO_MSG_NAK; in->fd = active_clients - 2; s = response_path; @@ -626,6 +632,10 @@ static void pseudo_server_loop_epoll(void) }; clients = malloc(16 * sizeof(*clients)); + if (!clients) { + pseudo_diag("out of memory allocating client table.\n"); + exit(PSEUDO_EXIT_LISTEN_FD); + } sigaction(SIGUSR2, &eat_usr2, NULL); @@ -796,6 +806,10 @@ pseudo_server_loop(void) { int hitmaxfiles; clients = malloc(16 * sizeof(*clients)); + if (!clients) { + pseudo_diag("out of memory allocating client table.\n"); + exit(PSEUDO_EXIT_LISTEN_FD); + } sigaction(SIGUSR2, &eat_usr2, NULL); diff --git a/pseudo_util.c b/pseudo_util.c index d16b14c..671ab7f 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -340,7 +340,10 @@ without_libpseudo(char *list) { return list; } list = strdup(list); - while (!(*real_regexec)(&libpseudo_regex, list, 1, pmatch, 0)) { + if (!list) { + pseudo_diag("Couldn't allocate memory to remove libpseudo from environment.\n"); + } + while (list && !(*real_regexec)(&libpseudo_regex, list, 1, pmatch, 0)) { char *start = list + pmatch[0].rm_so; char *end = list + pmatch[0].rm_eo; /* don't copy over the space or = */ @@ -895,6 +898,10 @@ pseudo_fix_path(const char *base, const char *path, size_t rootlen, size_t basel } if (!pathbufs[pathbuf]) { pathbufs[pathbuf] = malloc(newpathlen); + if (!pathbufs[pathbuf]) { + pseudo_diag("allocation failed seeking memory for path (%s).\n", path); + return 0; + } } newpath = pathbufs[pathbuf]; pathbuf = (pathbuf + 1) % PATHBUFS; @@ -1047,19 +1054,21 @@ pseudo_setupenv() { char *newenv = malloc(len); if (!newenv) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + } else { + snprintf(newenv, len, "%s:%s64", libdir_path, libdir_path); + SETENV(PRELINK_PATH, newenv, 1); + free(newenv); } - snprintf(newenv, len, "%s:%s64", libdir_path, libdir_path); - SETENV(PRELINK_PATH, newenv, 1); - free(newenv); } else if (!strstr(ld_library_path, libdir_path)) { size_t len = strlen(ld_library_path) + 1 + strlen(libdir_path) + 1 + (strlen(libdir_path) + 2) + 1; char *newenv = malloc(len); if (!newenv) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + } else { + snprintf(newenv, len, "%s:%s:%s64", ld_library_path, libdir_path, libdir_path); + SETENV(PRELINK_PATH, newenv, 1); + free(newenv); } - snprintf(newenv, len, "%s:%s:%s64", ld_library_path, libdir_path, libdir_path); - SETENV(PRELINK_PATH, newenv, 1); - free(newenv); } else { /* nothing to do, ld_library_path exists and contains * our preferred path */ @@ -1070,16 +1079,18 @@ pseudo_setupenv() { ld_preload = with_libpseudo(ld_preload, libdir_path); if (!ld_preload) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + } else { + SETENV(PRELINK_LIBRARIES, ld_preload, 1); + free(ld_preload); } - SETENV(PRELINK_LIBRARIES, ld_preload, 1); - free(ld_preload); } else { ld_preload = with_libpseudo("", libdir_path); if (!ld_preload) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + } else { + SETENV(PRELINK_LIBRARIES, ld_preload, 1); + free(ld_preload); } - SETENV(PRELINK_LIBRARIES, ld_preload, 1); - free(ld_preload); } /* we kept libdir path until now because with_libpseudo might @@ -1149,17 +1160,19 @@ pseudo_setupenvp(char * const *envp) { char *newenv = malloc(len); if (!newenv) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + } else { + snprintf(newenv, len, PRELINK_PATH "=%s:%s64", libdir_path, libdir_path); + new_envp[j++] = newenv; } - snprintf(newenv, len, PRELINK_PATH "=%s:%s64", libdir_path, libdir_path); - new_envp[j++] = newenv; } else if (!strstr(ld_library_path, libdir_path)) { size_t len = strlen(ld_library_path) + 1 + strlen(libdir_path) + 1 + (strlen(libdir_path) + 2) + 1; char *newenv = malloc(len); if (!newenv) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + } else { + snprintf(newenv, len, "%s:%s:%s64", ld_library_path, libdir_path, libdir_path); + new_envp[j++] = newenv; } - snprintf(newenv, len, "%s:%s:%s64", ld_library_path, libdir_path, libdir_path); - new_envp[j++] = newenv; } else { /* keep old value */ new_envp[j++] = ld_library_path; @@ -1169,15 +1182,22 @@ pseudo_setupenvp(char * const *envp) { ld_preload = with_libpseudo(ld_preload, libdir_path); if (!ld_preload) { pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); - } - new_envp[j++] = ld_preload; + } else + new_envp[j++] = ld_preload; } else { ld_preload = with_libpseudo("", libdir_path); - size_t len = strlen(PRELINK_LIBRARIES "=") + strlen(ld_preload) + 1; - char *newenv = malloc(len); - snprintf(newenv, len, PRELINK_LIBRARIES "=%s", ld_preload); - new_envp[j++] = newenv; - free(ld_preload); + if (!ld_preload) { + pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + } else { + size_t len = strlen(PRELINK_LIBRARIES "=") + strlen(ld_preload) + 1; + char *newenv = malloc(len); + if (!newenv) { + pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + } + snprintf(newenv, len, PRELINK_LIBRARIES "=%s", ld_preload); + new_envp[j++] = newenv; + free(ld_preload); + } } free(libdir_path); From patchwork Thu Jan 15 23:43:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39DFCD47CA4 for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.845.1768520625001877068 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjo2408772; Thu, 15 Jan 2026 17:43:42 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 19/20] configure: Minor code quality changes Date: Thu, 15 Jan 2026 17:43:35 -0600 Message-Id: <1768520616-7289-20-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2990 From: Mark Hatle AI-Generated: Suggested by GitHub Copilot (Claude Sonnet 4.5) Signed-off-by: Mark Hatle --- configure | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/configure b/configure index d596a35..68c9962 100755 --- a/configure +++ b/configure @@ -56,17 +56,17 @@ use_maybe_rpath=true for arg do - case $arg in + case "$arg" in --disable-*) arg="--enable-${arg%--disable-}=no" ;; esac - case $arg in + case "$arg" in --) shift; break ;; --prefix=*) opt_prefix=${arg#--prefix=} if [ -d "$opt_prefix" ]; then - maybe_prefix=$(cd "$opt_prefix"; pwd) + maybe_prefix=$(cd "$opt_prefix" && pwd) else maybe_prefix=$opt_prefix fi @@ -169,7 +169,7 @@ do esac done -case $opt_arch in +case "$opt_arch" in '' | x86 | arm ) ;; *) echo >&2 "Untested arch $opt_arch." @@ -178,7 +178,7 @@ esac if [ -z "$opt_bits" ]; then printf >&2 "Bit width unspecified;" - case $(file -L /bin/sh 2>/dev/null) in + case "$(file -L /bin/sh 2>/dev/null)" in *64-bit*) opt_bits=64;; *32-bit*) opt_bits=32;; esac @@ -241,6 +241,10 @@ read t1 t2 SQLITE3_VERSION << EOF `grep "#define SQLITE_VERSION_NUMBER " ${opt_sqlite}/include/sqlite3.h` EOF +if [ -z "${SQLITE3_VERSION}" ]; then + echo >&2 "Could not determine SQLite version from header." + exit 1 +fi echo "SQLite header for version ${SQLITE3_VERSION} found in ${opt_sqlite}." if [ "${SQLITE3_VERSION}" -lt "03006000" ]; then @@ -292,7 +296,7 @@ fi if $opt_xattr || $opt_xattrdb; then if ! $xattr_runs; then - echo >&2 "WARNING: getfattr doesn't work, but xattr-related features requestd." + echo >&2 "WARNING: getfattr doesn't work, but xattr-related features requested." fi fi @@ -327,6 +331,7 @@ fi touch port_deps.mk touch func_deps.mk +rm -f Makefile sed -e ' s,@PREFIX@,'"$opt_prefix"',g s,@EPOLL@,'"$EPOLL"',g @@ -350,4 +355,4 @@ sed -e ' s,@BITS@,'"$opt_bits"',g ' < Makefile.in > Makefile -sed -i -e 's/\-[f]*pie//g' Makefile +sed Makefile -e 's/\-[f]*pie//g' > Makefile.tmp && mv Makefile.tmp Makefile From patchwork Thu Jan 15 23:43:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hatle X-Patchwork-Id: 78840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55543D47CAB for ; Thu, 15 Jan 2026 23:43:50 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.763.1768520625001704106 for ; Thu, 15 Jan 2026 15:43:45 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from kernel.crashing.org.net (70-99-78-136.nuveramail.net [70.99.78.136] (may be forged)) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 60FNhbjp2408772; Thu, 15 Jan 2026 17:43:43 -0600 From: Mark Hatle To: yocto-patches@lists.yoctoproject.org Cc: seebs@seebs.net, richard.purdie@linuxfoundation.org Subject: [pseudo][PATCH 20/20] Makefile.in: Bump version to 1.9.3 Date: Thu, 15 Jan 2026 17:43:36 -0600 Message-Id: <1768520616-7289-21-git-send-email-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> References: <1768520616-7289-1-git-send-email-mark.hatle@kernel.crashing.org> List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Jan 2026 23:43:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/2988 Update the ChangeLog.txt to indicate it's obsolete. Signed-off-by: Mark Hatle --- ChangeLog.txt | 4 ++++ Makefile.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f681596..38e2cbf 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +This changelog is obsolete, it stopped being updated as of commit +097ca3e245200c4a4333964af59a106c42ff3bca. See the git log for up to +date changes. + 2019-08-02: * (seebs) Pass flags & O_NOFOLLOW, also use that to influence stat types. Note. &. Not |. diff --git a/Makefile.in b/Makefile.in index 3b60cf8..8bf3f48 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,7 +34,7 @@ BITS=@BITS@ ARCH_FLAGS=@ARCH_FLAGS@ MARK64=@MARK64@ RPATH=@RPATH@ -VERSION=1.9.2 +VERSION=1.9.3 LIB=@LIB@ BIN=bin