All of lore.kernel.org
 help / color / mirror / Atom feed
* [pseudo][PATCH 00/20] Consolidated pseudo patches
@ 2026-01-15 23:43 Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 01/20] test-syscall: Remove build warning Mark Hatle
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

This is the full set of pending changes.  Many of which have already
been sent to the mailing list.  This set matches 'fray/master' branch
in the repository.

The new features in this set include:

* Test harness improvements (better display, more robust)
* Realpath POSIX fix from Gauthier HADERER
* Linux path traversal into /proc fixes
* General cleanup

This along with the other changes that have recently gone in should
get us to 1.9.3 or even 2.0.0.


Note: the test suite still shows there are problems with parallel
rename and symlink operations.  These are reported but we don't
have any sort of a fix in mind yet.

renameat2 is not implemented, this will require potentially extensive
changes to pseudo to allow for atomic exchange (rename).  It will
return ENOSYS until then.

openat2 is not implemented, a prototype version of this code was
created, but does not yet pass testing.  This also returns ENOSYS.

Gauthier HADERER (1):
  ports/unix/guts/realpath.c: realpath fails if the resolved path
    doesn't exist

Mark Hatle (19):
  test-syscall: Remove build warning
  test: Cleanup test output
  test/test-statx.sh: It should be a failure if pseudo prints an error
  test-realpath: Verify the realpath behavior matches glibc
  run_tests.sh: In verbose mode, include pseudo.log in output
  test/test-statx: Add uutils test case
  test/test-nftw: Avoid compile warnings
  test-tclsh-fork: Skip test if tclsh is not available
  test/test-proc-pipe.sh: Add test case for proc pipes
  pseudo_util.c: Skip realpath like expansion for /proc on Linux
  ports/unix/guts/realpath.c: Fix indents
  ports/linux/pseudo_wrappers.c: Reorder the syscall operations
  ports/linux/pseudo_wrappers.c: Call the wrappers where possible
  ports/linux: Add additional EFAULTS for Linux functions
  Update COPYRIGHT files
  makewrappers: improve error handling and robustness
  pseudo: code quality scan - resolved various potential issues
  configure: Minor code quality changes
  Makefile.in: Bump version to 1.9.3

 ChangeLog.txt                       |   4 +
 Makefile.in                         |   5 +-
 configure                           |  19 ++--
 guts/COPYRIGHT                      |   2 +
 makewrappers                        |  73 ++++++++-------
 ports/darwin/guts/COPYRIGHT         |   1 +
 ports/linux/guts/COPYRIGHT          |   2 +
 ports/linux/openat2/wrapfuncs.in    |   2 +-
 ports/linux/pseudo_wrappers.c       |  46 ++++++----
 ports/linux/wrapfuncs.in            |  22 ++---
 ports/linux/xattr/wrapfuncs.in      |  16 ++--
 ports/uids_generic/guts/COPYRIGHT   |   1 +
 ports/unix/guts/COPYRIGHT           |   2 +
 ports/unix/guts/fts_open.c          |   5 +-
 ports/unix/guts/nftw_wrapper_base.c |  11 +--
 ports/unix/guts/realpath.c          |  23 +++--
 pseudo.c                            |  61 ++++++++-----
 pseudo_client.c                     |   4 +
 pseudo_db.c                         |  10 +++
 pseudo_server.c                     |  14 +++
 pseudo_util.c                       | 132 +++++++++++++++++++++++-----
 run_tests.sh                        |  28 ++++--
 test/nftw-test-impl.c               |   2 +
 test/test-acl.sh                    |  16 ++++
 test/test-proc-pipe.sh              |  27 ++++++
 test/test-realpath.c                |  17 ++++
 test/test-realpath.sh               |  63 +++++++++++++
 test/test-statx.sh                  |  39 +++++++-
 test/test-syscall.c                 |   2 +-
 test/test-tclsh-fork.sh             |   5 ++
 test/test-xattr.sh                  |  17 ++++
 31 files changed, 525 insertions(+), 146 deletions(-)
 create mode 100755 test/test-proc-pipe.sh
 create mode 100644 test/test-realpath.c
 create mode 100755 test/test-realpath.sh

-- 
2.43.0



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 01/20] test-syscall: Remove build warning
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 02/20] test: Cleanup test output Mark Hatle
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Compiler is warning about argc and argv not being used.

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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 <string.h>
 #include <errno.h>
 
-int main(int argc, char *argv[]) {
+int main() {
     long rc = 0;
 
 #ifdef SYS_renameat2
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 02/20] test: Cleanup test output
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 01/20] test-syscall: Remove build warning Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 03/20] test/test-statx.sh: It should be a failure if pseudo prints an error Mark Hatle
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

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 <mark.hatle@kernel.crashing.org>
---
 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" ]
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 03/20] test/test-statx.sh: It should be a failure if pseudo prints an error
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 01/20] test-syscall: Remove build warning Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 02/20] test: Cleanup test output Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 04/20] test-realpath: Verify the realpath behavior matches glibc Mark Hatle
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

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 <mark.hatle@kernel.crashing.org>
---
 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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 04/20] test-realpath: Verify the realpath behavior matches glibc
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (2 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 03/20] test/test-statx.sh: It should be a failure if pseudo prints an error Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 05/20] run_tests.sh: In verbose mode, include pseudo.log in output Mark Hatle
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

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 <mark.hatle@kernel.crashing.org>
---
 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 <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 05/20] run_tests.sh: In verbose mode, include pseudo.log in output
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (3 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 04/20] test-realpath: Verify the realpath behavior matches glibc Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 06/20] test/test-statx: Add uutils test case Mark Hatle
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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++
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 06/20] test/test-statx: Add uutils test case
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (4 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 05/20] run_tests.sh: In verbose mode, include pseudo.log in output Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 07/20] test/test-nftw: Avoid compile warnings Mark Hatle
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 07/20] test/test-nftw: Avoid compile warnings
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (5 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 06/20] test/test-statx: Add uutils test case Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 08/20] test-tclsh-fork: Skip test if tclsh is not available Mark Hatle
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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);
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 08/20] test-tclsh-fork: Skip test if tclsh is not available
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (6 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 07/20] test/test-nftw: Avoid compile warnings Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 09/20] ports/unix/guts/realpath.c: realpath fails if the resolved path doesn't exist Mark Hatle
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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.
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 09/20] ports/unix/guts/realpath.c: realpath fails if the resolved path doesn't exist
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (7 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 08/20] test-tclsh-fork: Skip test if tclsh is not available Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 10/20] test/test-proc-pipe.sh: Add test case for proc pipes Mark Hatle
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Gauthier HADERER <ghaderer@wyplay.com>

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/<pid>/fd/pipe:[xxxxxx]'. As it got a path, the tail command tries to
open it and fails.

Contributed-by: Gauthier HADERER <ghaderer@wyplay.com> via
yocto-patches@lists.yoctoproject.org

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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 == '/') {
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 10/20] test/test-proc-pipe.sh: Add test case for proc pipes
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (8 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 09/20] ports/unix/guts/realpath.c: realpath fails if the resolved path doesn't exist Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 11/20] pseudo_util.c: Skip realpath like expansion for /proc on Linux Mark Hatle
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Mark Hatle <mark.hatle@amd.com>

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 <ghaderer@wyplay.com>

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 11/20] pseudo_util.c: Skip realpath like expansion for /proc on Linux
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (9 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 10/20] test/test-proc-pipe.sh: Add test case for proc pipes Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 12/20] ports/unix/guts/realpath.c: Fix indents Mark Hatle
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Mark Hatle <mark.hatle@amd.com>

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 <ghaderer@wyplay.com>

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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 : "<nil>");
+		/* 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;
 }
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 12/20] ports/unix/guts/realpath.c: Fix indents
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (10 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 11/20] pseudo_util.c: Skip realpath like expansion for /proc on Linux Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations Mark Hatle
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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;
 	}
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (11 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 12/20] ports/unix/guts/realpath.c: Fix indents Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 14/20] ports/linux/pseudo_wrappers.c: Call the wrappers where possible Mark Hatle
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

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 <mark.hatle@kernel.crashing.org>
---
 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?
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 14/20] ports/linux/pseudo_wrappers.c: Call the wrappers where possible
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (12 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions Mark Hatle
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

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 <mark.hatle@kernel.crashing.org>
---
 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
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (13 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 14/20] ports/linux/pseudo_wrappers.c: Call the wrappers where possible Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 16/20] Update COPYRIGHT files Mark Hatle
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

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 <mark.hatle@kernel.crashing.org>
---
 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" */
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 16/20] Update COPYRIGHT files
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (14 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 17/20] makewrappers: improve error handling and robustness Mark Hatle
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Mark Hatle <mark.hatle@amd.com>

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
 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 <seebs@seebs.net>
+ * 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 <seebs@seebs.net>
  *
  * 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 <seebs@seebs.net>
+ * 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 <seebs@seebs.net>
  *
  * 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 <seebs@seebs.net>
+ * Copyright (C) 2020-2026 Yocto Project Contributors
  *
  * SPDX-License-Identifier: LGPL-2.1-only
  *
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 17/20] makewrappers: improve error handling and robustness
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (15 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 16/20] Update COPYRIGHT files Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 18/20] pseudo: code quality scan - resolved various potential issues Mark Hatle
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Mark Hatle <mark.hatle@amd.com>

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 <mark.hatle@amd.com>
---
 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('==','<equals>')
+            # 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...")
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 18/20] pseudo: code quality scan - resolved various potential issues
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (16 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 17/20] makewrappers: improve error handling and robustness Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 19/20] configure: Minor code quality changes Mark Hatle
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Mark Hatle <mark.hatle@amd.com>

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 <mark.hatle@amd.com>
---
 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);
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 19/20] configure: Minor code quality changes
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (17 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 18/20] pseudo: code quality scan - resolved various potential issues Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
  2026-01-15 23:43 ` [pseudo][PATCH 20/20] Makefile.in: Bump version to 1.9.3 Mark Hatle
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

From: Mark Hatle <mark.hatle@amd.com>

AI-Generated: Suggested by GitHub Copilot (Claude Sonnet 4.5)

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
 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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [pseudo][PATCH 20/20] Makefile.in: Bump version to 1.9.3
  2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
                   ` (18 preceding siblings ...)
  2026-01-15 23:43 ` [pseudo][PATCH 19/20] configure: Minor code quality changes Mark Hatle
@ 2026-01-15 23:43 ` Mark Hatle
       [not found] ` <188B0C23901378A4.2703508@lists.yoctoproject.org>
       [not found] ` <188B0C2348C47D4E.2703508@lists.yoctoproject.org>
  21 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-15 23:43 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

Update the ChangeLog.txt to indicate it's obsolete.

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [yocto-patches] [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations
       [not found] ` <188B0C23901378A4.2703508@lists.yoctoproject.org>
@ 2026-01-17 16:08   ` Mark Hatle
  0 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-17 16:08 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie



On 1/15/26 5:43 PM, Mark Hatle wrote:
> 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 <mark.hatle@kernel.crashing.org>
> ---
>   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:

On Debian 11 this fails to compile.  I had to add a patch to workaround what I 
suspect is a compiler bug:

  call_syscall:
+       /* On Debian 11 - gcc (Debian 10.2.1-6) this results in:
+        *   error: a label can only be part of a statement and a declaration
+        *   is not a statement
+        *
+        * adding a ; here resolves this
+        */
+       ;
+




>   	/* 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?


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [yocto-patches] [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions
       [not found] ` <188B0C2348C47D4E.2703508@lists.yoctoproject.org>
@ 2026-01-17 16:10   ` Mark Hatle
  0 siblings, 0 replies; 23+ messages in thread
From: Mark Hatle @ 2026-01-17 16:10 UTC (permalink / raw)
  To: yocto-patches; +Cc: seebs, richard.purdie

I'm dropping this patch.  Debian 11 glibc has set more functions as path 
nonnull, so the compiler complains about the EFAULT check of path.

The original issue is still resolved, but if this nonnull behavior continues at 
some point it's going to show what rust is doing to check for xstat is indeed 
sketchy.

--Mark

On 1/15/26 5:43 PM, Mark Hatle wrote:
> 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 <mark.hatle@kernel.crashing.org>
> ---
>   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" */


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2026-01-17 16:11 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-15 23:43 [pseudo][PATCH 00/20] Consolidated pseudo patches Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 01/20] test-syscall: Remove build warning Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 02/20] test: Cleanup test output Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 03/20] test/test-statx.sh: It should be a failure if pseudo prints an error Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 04/20] test-realpath: Verify the realpath behavior matches glibc Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 05/20] run_tests.sh: In verbose mode, include pseudo.log in output Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 06/20] test/test-statx: Add uutils test case Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 07/20] test/test-nftw: Avoid compile warnings Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 08/20] test-tclsh-fork: Skip test if tclsh is not available Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 09/20] ports/unix/guts/realpath.c: realpath fails if the resolved path doesn't exist Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 10/20] test/test-proc-pipe.sh: Add test case for proc pipes Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 11/20] pseudo_util.c: Skip realpath like expansion for /proc on Linux Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 12/20] ports/unix/guts/realpath.c: Fix indents Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 14/20] ports/linux/pseudo_wrappers.c: Call the wrappers where possible Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 16/20] Update COPYRIGHT files Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 17/20] makewrappers: improve error handling and robustness Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 18/20] pseudo: code quality scan - resolved various potential issues Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 19/20] configure: Minor code quality changes Mark Hatle
2026-01-15 23:43 ` [pseudo][PATCH 20/20] Makefile.in: Bump version to 1.9.3 Mark Hatle
     [not found] ` <188B0C23901378A4.2703508@lists.yoctoproject.org>
2026-01-17 16:08   ` [yocto-patches] [pseudo][PATCH 13/20] ports/linux/pseudo_wrappers.c: Reorder the syscall operations Mark Hatle
     [not found] ` <188B0C2348C47D4E.2703508@lists.yoctoproject.org>
2026-01-17 16:10   ` [yocto-patches] [pseudo][PATCH 15/20] ports/linux: Add additional EFAULTS for Linux functions Mark Hatle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.