Running the following script under pseudo fails on Arch Linux, and has for at least the past several months if not longer: `echo foo | xz > out.xz`. gzip and zstd do not exhibit this issue. Root cause is as follows. Root cause is that xz aggressively sandboxes itself when the APIs are available, including landlock (https://docs.kernel.org/userspace-api/landlock.html). In particular, when xz is used as a pipeline, it will configure landlock to disable ALL file I/O privileges. This breaks pseudo_client.c because it lazy-connects to the pseudo server on the first intercepted syscall and opens a small but non-zero number of paths in the process, including "." and PSEUDO_PIDFILE. This has likely gone undiscovered in my org because most coworkers are either running their OE builds in Ubuntu containers, or are driving pseudo from Ubuntu build machines. (I hypothesize that landlock winds up not being online there though I haven't confirmed). Note that the xz devs appear to acknowledge that this is somewhat of a quixotic endeavour, cf. src/xz/sandbox.c:prepare_for_strict_sandbox(). Nevertheless, with the increased attention being paid to security hardening at many organizations, I expect pledge()-like facilities to get a lot more use over the next few years. My best guess at how this ought to be fixed is that client_connect() probably needs to be shoved up to pseudo_init_client(). There are obvious performance implications, and perhaps it should be made optional.
β¦or maybe pseudo should wrap landlock too. Eheh.