<feed xmlns='http://www.w3.org/2005/Atom'>
<title>procd/trace, branch master</title>
<subtitle>OpenWrt service / process manager</subtitle>
<id>https://git.openwrt.org/project/procd/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/procd/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/'/>
<updated>2026-08-21T04:31:44Z</updated>
<entry>
<title>build: add the trace2seccomp profile generator, drop the utrace target</title>
<updated>2026-08-21T04:31:44Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2026-06-17T22:31:38Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=9f32e85e7cebc618f3f1f036087a0d81f506eeb3'/>
<id>urn:sha1:9f32e85e7cebc618f3f1f036087a0d81f506eeb3</id>
<content type='text'>
Replace the C utrace binary and its LD_PRELOAD trace helper with
trace2seccomp, a ucode tool that turns a ujail seccomp trace into an OCI
seccomp profile. The old preload approach only worked for dynamically
linked binaries and required a private libpreload; the new tracer in ujail
(-m trace) handles static binaries and reports per-phase syscall sets, so
the generator can work purely from its NDJSON output.

Dispatched by argv[0]: invoked as utrace or seccomp-trace it runs a program
under `ujail -m trace` and emits an application-phase allow-list, matching
the classic policy-generation window. Invoked as trace2seccomp it converts
a previously captured NDJSON trace, optionally merging all phases or
emitting a two-phase pre/post dynamic-linker profile.

The CMake UTRACE_SUPPORT target now installs the script instead of building
the dropped utrace and preload-trace artefacts.

Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
<entry>
<title>jail: apply OCI seccomp filters via ptrace syscall injection</title>
<updated>2026-08-21T04:30:22Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2026-06-17T13:50:35Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=f15d0c407c09c2b10791065c3a2f2ef208448b46'/>
<id>urn:sha1:f15d0c407c09c2b10791065c3a2f2ef208448b46</id>
<content type='text'>
Arm the compiled cBPF profile by injecting prctl(NO_NEW_PRIVS) and
seccomp(SET_MODE_FILTER) into the freshly-execve'd workload over ptrace.
The child does PTRACE_TRACEME before its final execve; the parent catches
the post-execve stop, drives the two syscalls via a temporary trap at the
program counter, restores registers and code, then detaches. This installs
the filter for static binaries too, closing the gap left by the dropped
LD_PRELOAD installer (preload.c, seccomp.c and the shared library are removed).

A dynamic binary needs extra loader and libc pre-main syscalls. They are
granted once in a phase-1 app + linker_base filter, then revoked with deny
deltas at the entry and main boundaries (located via AT_BASE/auxv and ELF
marker addresses), each delta reverting to the profile default. Static and
Go-style binaries collapse to fewer phases. NOTIFY or flag profiles still go
in-process; audit and complain modes reuse the same staging to log denials.

Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
<entry>
<title>jail/seccomp: add support for loongarch64</title>
<updated>2024-12-22T16:04:11Z</updated>
<author>
<name>Weijie Gao</name>
</author>
<published>2024-12-22T10:28:12Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=42d3937654508b04da64969f9d764ac2ec411904'/>
<id>urn:sha1:42d3937654508b04da64969f9d764ac2ec411904</id>
<content type='text'>
Add support for loongarch64 in utrace and ujail.

Signed-off-by: Weijie Gao &lt;hackpascal@gmail.com&gt;
</content>
</entry>
<entry>
<title>trace: use standard POSIX header for basename()</title>
<updated>2024-03-30T21:30:41Z</updated>
<author>
<name>Tony Ambardar</name>
</author>
<published>2024-03-06T00:27:42Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=946552a7b598a0b88db6101e864679554ec4f221'/>
<id>urn:sha1:946552a7b598a0b88db6101e864679554ec4f221</id>
<content type='text'>
The musl libc only implements POSIX basename() but provided a GNU header
kludge in &lt;string.h&gt;, which was removed in musl 1.2.5 [1]. Use the standard
&lt;libgen.h&gt; header to avoid compilation errors like:

trace/trace.c: In function 'main':
trace/trace.c:435:64: error: implicit declaration of function 'basename';
did you mean 'rename'? [-Werror=implicit-function-declaration]
  435 | if (asprintf(&amp;json, "/tmp/%s.%u.json", basename(*argv), child) &lt; 0)
      |                                        ^~~~~~~~
      |                                        rename
cc1: all warnings being treated as errors

Link 1: https://git.musl-libc.org/cgit/musl/log/?qt=grep&amp;q=basename

Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>utrace: fix memory leak</title>
<updated>2022-06-27T09:52:10Z</updated>
<author>
<name>Junnan Xu</name>
</author>
<published>2022-06-17T07:20:04Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=a68088ef3160d75f02bb6af5f552ca507e51df56'/>
<id>urn:sha1:a68088ef3160d75f02bb6af5f552ca507e51df56</id>
<content type='text'>
Fixes following memory leak:

  14 bytes in 1 blocks are definitely lost in loss record 1 of 5
     at 0x4079514: malloc (vg_replace_malloc.c:309)
     by 0x4049A04: vasprintf (vasprintf.c:13)
     by 0x4046354: asprintf (asprintf.c:10)
     by 0x80491A9: main (in /root/utrace)

  134 bytes in 1 blocks are definitely lost in loss record 3 of 5
     at 0x4079514: malloc (vg_replace_malloc.c:309)
     by 0x4049A04: vasprintf (vasprintf.c:13)
     by 0x4046354: asprintf (asprintf.c:10)
     by 0x8049208: main (in /root/utrace)

Signed-off-by: Junnan Xu &lt;junnanx.xu@gmail.com&gt;
Reviewed-by: Rui Salvaterra &lt;rsalvaterra@gmail.com&gt;
</content>
</entry>
<entry>
<title>trace: don't leak file descriptor in error path</title>
<updated>2021-09-15T20:43:16Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2021-09-05T13:22:33Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=8a60e7e066cb0b364cae13c524dce16743633b0a'/>
<id>urn:sha1:8a60e7e066cb0b364cae13c524dce16743633b0a</id>
<content type='text'>
Coverity CID: 1491022 Resource leak
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
<entry>
<title>trace: preload: avoid NULL-dereference here as well</title>
<updated>2021-08-30T23:46:59Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2021-08-30T23:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=269c9e4c7e5b6a726712abf939255980f03266c5'/>
<id>urn:sha1:269c9e4c7e5b6a726712abf939255980f03266c5</id>
<content type='text'>
Fix potential NULL-pointer derefence in trace/preload.c similar to how
it was fixed in jail/preload.c by commit b824a89
("jail: preload: avoid NULL-dereference in case things go wrong").

Coverity CID: 1446096 Dereference after null check
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
<entry>
<title>trace: fix potential use-after-free occurence</title>
<updated>2021-08-30T21:15:10Z</updated>
<author>
<name>Nick Hainke</name>
</author>
<published>2021-08-30T20:37:10Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=96d8bf2c7b6773636efb8b175993e5d17ff7d0bf'/>
<id>urn:sha1:96d8bf2c7b6773636efb8b175993e5d17ff7d0bf</id>
<content type='text'>
char* tmp is used in the fprintf function altough it is already freed.

Fixes: e5b38fd1 ("trace: free memory allocated by blobmsg_format_json_indent()")

Signed-off-by: Nick Hainke &lt;vincent@systemli.org&gt;
</content>
</entry>
<entry>
<title>trace: free memory allocated by blobmsg_format_json_indent()</title>
<updated>2021-08-30T19:30:43Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2021-08-30T19:20:49Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=e5b38fd1298cec50f68b01568fcecf5e626cd286'/>
<id>urn:sha1:e5b38fd1298cec50f68b01568fcecf5e626cd286</id>
<content type='text'>
Only one out of two occurances have been addressed previously.
Close the other one now.

Coverity CID: 1446205
Fixes: 51f1cd23 ("trace: free string returned by blobmsg_format_json_indent()")
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
<entry>
<title>trace: handle open() return value and make sure string is terminated</title>
<updated>2021-08-24T17:32:01Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2021-08-23T17:11:08Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/procd/commit/?id=d716cb5ca3c27e7bff2ab6f793aa4b827fdd3290'/>
<id>urn:sha1:d716cb5ca3c27e7bff2ab6f793aa4b827fdd3290</id>
<content type='text'>
Coverity CID: 1446154 Argument cannot be negative

Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
</feed>
