<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Firmdura on Medium]]></title>
        <description><![CDATA[Stories by Firmdura on Medium]]></description>
        <link>https://medium.com/@firmdurasecurity?source=rss-01e5d3768d96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Vd3nKct93xkyynH1-a5GKw.png</url>
            <title>Stories by Firmdura on Medium</title>
            <link>https://medium.com/@firmdurasecurity?source=rss-01e5d3768d96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 17:11:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@firmdurasecurity/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Checking Your Embedded Linux Patches Before You Flash Anything: A Casual Guide to TargetCheck]]></title>
            <link>https://medium.com/@firmdurasecurity/checking-your-embedded-linux-patches-before-you-flash-anything-a-casual-guide-to-targetcheck-c215ce30360f?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/c215ce30360f</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[go-programming-language]]></category>
            <category><![CDATA[qemu]]></category>
            <category><![CDATA[firmware]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sat, 28 Nov 2026 10:01:40 GMT</pubDate>
            <atom:updated>2026-11-28T10:23:12.325Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="TargetCheck v1.0.1 GitHub Actions log excerpt showing successful native, regression, and ARM quickstart checks." src="https://cdn-images-1.medium.com/max/1024/1*SMXkNZ1t82bZNpfIymtoRQ.png" /><figcaption>Quickstart results from the TargetCheck v1.0.1 release CI run on Linux amd64.</figcaption></figure><p>If you maintain embedded Linux firmware, you probably know this sinking feeling: you backport a CVE patch to a C library or CLI tool, bitbake or make finishes with zero warnings, your local x86_64 tests look great, and then two weeks later someone discovers it quietly broke on 32-bit ARM hardware.</p><p>That exact headache is why <a href="https://github.com/firmdura/targetcheck">TargetCheck</a> exists.</p><p>Built by Firmdura in Go (and licensed under Apache-2.0), TargetCheck is a small CLI tool and Go library (v1.0.1) designed to answer one specific question before you waste time rebuilding an entire firmware image:</p><p><strong>If I take my component <em>before</em> the patch (the baseline) and <em>after</em> the patch (the candidate), build both, and run the exact same tests on native Linux and 32-bit ARM, do both behave exactly how I expect?</strong></p><p>Let’s walk through why that matters, how to run it in a few minutes, and how to wire it into your own workflow.</p><h3>Why is TargetCheck actually useful?</h3><p>Most test runners only check whether your patched code passes tests <em>right now</em>. When you’re backporting security fixes for embedded targets, that leaves three big blind spots.</p><h4>1. 64-bit hosts hide 32-bit bugs</h4><p>TargetCheck ships with a real-world example using GNU Wget 1.21.4 and CVE-2026-58470, an integer overflow in parse_content_range().</p><p>Upstream’s first fix replaced a manual digit loop with strtol(). On a 64-bit x86_64 laptop, long is 64 bits wide, so everything compiled cleanly and passed large-offset tests. On 32-bit ARM (armhf), long is only 32 bits wide, even though Wget&#39;s own wgint offset type is 64-bit (int64_t). Result: the cross-compile succeeded, the binary built fine, and Wget suddenly failed to parse valid Content-Range offsets past 2 GiB on 32-bit ARM. Upstream later had to follow up with strtoll().</p><p>TargetCheck lets you run the exact same test binary natively <em>and</em> as an ARM32 hard-float (EABI5) binary under qemu-arm user mode in seconds, catching ABI and word-size surprises long before you boot a board or spin up a full image build.</p><h4>2. It proves the baseline broke the way you think it did</h4><p>A classic testing trap is writing a test that passes on the patched code, only to realize later the test never actually triggered the original bug.</p><p>In TargetCheck, you define expectations for <strong>both</strong> variants:</p><p>• For the <strong>baseline</strong>, you can declare an <em>expected failure</em> (a specific nonzero exit code plus a literal text marker in stdout or stderr, like a failing assertion or a sanitizer message).</p><p>• For the <strong>candidate</strong>, you require exit code 0 and a pass marker.</p><p>If your baseline segfaults instead of printing the expected diagnostic, or exits with the wrong code, TargetCheck does <strong>not</strong> let it pass by accident. Signals, timeouts, and missing tools always fail the run.</p><h4>3. You get an audit trail instead of “trust me, it passed locally”</h4><p>When you’re shipping patches for CRA compliance, customer reviews, or internal release gates, scrolling back through terminal history isn’t great evidence.</p><p>TargetCheck hashes your manifest, hashes your declared input files before building, and hashes the compiled executables <strong>both before and after running tests</strong> (so you know nothing mutated the binaries mid-run). It records resolved tool paths, the qemu-arm --version string, exact command argv arrays, and full stdout/stderr logs into a self-contained output folder with:</p><p>• report.json (the strict, machine-readable record)</p><p>• report.md (a clean summary you can drop into a PR or review doc)</p><p>• logs/ (captured stdout and stderr for every build and test step)</p><h4>4. It’s fast and stays out of your way</h4><p>You don’t need to boot QEMU full-system emulation or rebuild a Yocto/Buildroot rootfs just to test a parser fix in wget, curl, or libmodbus. TargetCheck runs commands directly via argv (no implicit shell expansion), enforces per-step timeouts, caps log capture at 1 MiB per stream, kills whole process groups if something hangs, and gives you unambiguous exit codes:</p><p><strong>Exit codes</strong></p><ul><li>0 (matched). Baseline and candidate both matched every expectation.</li><li>1 (mismatch). Everything ran cleanly, but at least one test missed its expected exit code or marker.</li><li>2 (error). Bad manifest, missing tool/sysroot, build failure, crash (signal), timeout, or I/O problem.</li><li>130 (cancelled). Interrupted (SIGINT, SIGTERM, SIGHUP) or context cancelled.</li></ul><h3>How to install it</h3><p>TargetCheck runs on Linux amd64 and arm64 (if you&#39;re on macOS, you can use the repo&#39;s pinned Docker image via make container-build, which comes with Go, GCC, arm-linux-gnueabihf-gcc, and qemu-arm ready to go).</p><p>You have two quick options on Linux:</p><p><strong>Option A: Grab the prebuilt static binary</strong> (great for CI and build servers):</p><pre>version=v1.0.1<br>arch=amd64 # or arm64<br>curl -fLO &quot;https://github.com/firmdura/targetcheck/releases/download/$version/targetcheck-$version-linux-$arch.tar.gz&quot;<br>curl -fLO &quot;https://github.com/firmdura/targetcheck/releases/download/$version/SHA256SUMS&quot;<br>sha256sum --ignore-missing -c SHA256SUMS<br>tar -xzf &quot;targetcheck-$version-linux-$arch.tar.gz&quot;<br>cd &quot;targetcheck-$version-linux-$arch&quot;<br>sha256sum -c SHA256SUMS<br>export PATH=&quot;$PWD:$PATH&quot;<br>targetcheck version</pre><p><strong>Option B: Install with Go</strong> (requires Go 1.27.4+):</p><pre>go install github.com/firmdura/targetcheck/cmd/targetcheck@v1.0.1</pre><p>If you want to run ARM32 tests on Debian/Ubuntu, install the cross toolchain and QEMU user mode:</p><pre>sudo apt-get install qemu-user gcc-arm-linux-gnueabihf libc6-dev-armhf-cross</pre><h3>Try the 2-minute quickstart</h3><p>The release archive and Git repo both include examples/quickstart, a tiny C program (port-check) where the baseline accepts port 70000 (silently wrapping it to 4464) and the candidate properly rejects it.</p><p>Copy it into a scratch directory (TargetCheck builds into the variant folders and refuses to overwrite an existing --output directory) and run the native comparison:</p><pre>work=$(cd &quot;$(mktemp -d)&quot; &amp;&amp; pwd -P)<br>cp -R examples/quickstart &quot;$work/root&quot;<br>targetcheck check \<br>  --manifest &quot;$work/root/native.json&quot; \<br>  --root &quot;$work/root&quot; \<br>  --output &quot;$work/report&quot;</pre><p>You’ll see:</p><pre>targetcheck: matched<br>JSON: &quot;/tmp/tmp.XXXXXXXXXX/report/report.json&quot;<br>Markdown: &quot;/tmp/tmp.XXXXXXXXXX/report/report.md&quot;</pre><p>Want to see it catch a broken fix? Copy baseline/port.c over candidate/port.c and run it again:</p><pre>work=$(cd &quot;$(mktemp -d)&quot; &amp;&amp; pwd -P)<br>cp -R examples/quickstart &quot;$work/root&quot;<br>cp &quot;$work/root/baseline/port.c&quot; &quot;$work/root/candidate/port.c&quot;<br>targetcheck check \<br>  --manifest &quot;$work/root/native.json&quot; \<br>  --root &quot;$work/root&quot; \<br>  --output &quot;$work/report&quot;<br>echo &quot;exit $?&quot;</pre><p>This time it prints targetcheck: mismatch and exits 1, and report.json tells you why:</p><pre>&quot;status&quot;: &quot;mismatch&quot;,<br>&quot;reason&quot;: &quot;exit 1; expected 0; stdout missing literal marker \&quot;PASS reject-out-of-range\&quot;&quot;</pre><p>And to run the exact same check as a 32-bit ARM binary under qemu-arm, just swap native.json for arm.json:</p><pre>work=$(cd &quot;$(mktemp -d)&quot; &amp;&amp; pwd -P)<br>cp -R examples/quickstart &quot;$work/root&quot;<br>targetcheck check \<br>  --manifest &quot;$work/root/arm.json&quot; \<br>  --root &quot;$work/root&quot; \<br>  --output &quot;$work/report&quot;</pre><p>If you inspect $work/report/report.json, you&#39;ll see the ELF metadata recorded right next to the artifact SHA-256 (&quot;class&quot;: &quot;ELF32&quot;, &quot;machine&quot;: &quot;EM_ARM&quot;).</p><h3>Using TargetCheck on your own component</h3><p>Once you’ve seen the quickstart, wiring up your own C/C++/etc. component takes four steps.</p><h4>Step 1: Set up two variant directories under one --root</h4><p>Keep baseline/ and candidate/ as separate directories under a single workspace root (neither nested inside the other). Two git worktree checkouts at the unpatched and patched commits work really well here.</p><h4>Step 2: Write a manifest (schema_version: 1)</h4><p>A manifest is a strict JSON file (no unknown keys, no variable interpolation, no implicit shell). Here is what examples/quickstart/arm.json looks like:</p><pre>{<br>  &quot;schema_version&quot;: 1,<br>  &quot;target&quot;: {<br>    &quot;kind&quot;: &quot;qemu-arm&quot;,<br>    &quot;executable&quot;: &quot;qemu-arm&quot;,<br>    &quot;sysroot&quot;: &quot;/usr/arm-linux-gnueabihf&quot;<br>  },<br>  &quot;variants&quot;: {<br>    &quot;baseline&quot;: {<br>      &quot;cwd&quot;: &quot;baseline&quot;,<br>      &quot;build&quot;: [<br>        {<br>          &quot;argv&quot;: [&quot;arm-linux-gnueabihf-gcc&quot;, &quot;-O2&quot;, &quot;-Wall&quot;, &quot;-Werror&quot;, &quot;-o&quot;, &quot;port-check&quot;, &quot;port.c&quot;],<br>          &quot;env&quot;: { &quot;LC_ALL&quot;: &quot;C&quot; },<br>          &quot;timeout_seconds&quot;: 120<br>        }<br>      ],<br>      &quot;inputs&quot;: [&quot;port.c&quot;],<br>      &quot;artifacts&quot;: [&quot;port-check&quot;]<br>    },<br>    &quot;candidate&quot;: {<br>      &quot;cwd&quot;: &quot;candidate&quot;,<br>      &quot;build&quot;: [<br>        {<br>          &quot;argv&quot;: [&quot;arm-linux-gnueabihf-gcc&quot;, &quot;-O2&quot;, &quot;-Wall&quot;, &quot;-Werror&quot;, &quot;-o&quot;, &quot;port-check&quot;, &quot;port.c&quot;],<br>          &quot;env&quot;: { &quot;LC_ALL&quot;: &quot;C&quot; },<br>          &quot;timeout_seconds&quot;: 120<br>        }<br>      ],<br>      &quot;inputs&quot;: [&quot;port.c&quot;],<br>      &quot;artifacts&quot;: [&quot;port-check&quot;]<br>    }<br>  },<br>  &quot;test_inputs&quot;: [],<br>  &quot;tests&quot;: [<br>    {<br>      &quot;id&quot;: &quot;valid-port&quot;,<br>      &quot;argv&quot;: [&quot;port-check&quot;, &quot;valid-port&quot;],<br>      &quot;timeout_seconds&quot;: 30,<br>      &quot;baseline_expect&quot;: {<br>        &quot;exit_code&quot;: 0,<br>        &quot;stdout_contains&quot;: &quot;PASS valid-port&quot;<br>      },<br>      &quot;candidate_expect&quot;: {<br>        &quot;exit_code&quot;: 0,<br>        &quot;stdout_contains&quot;: &quot;PASS valid-port&quot;<br>      }<br>    },<br>    {<br>      &quot;id&quot;: &quot;reject-out-of-range&quot;,<br>      &quot;argv&quot;: [&quot;port-check&quot;, &quot;reject-out-of-range&quot;],<br>      &quot;timeout_seconds&quot;: 30,<br>      &quot;baseline_expect&quot;: {<br>        &quot;exit_code&quot;: 1,<br>        &quot;stdout_contains&quot;: &quot;FAIL reject-out-of-range: \&quot;70000\&quot; was accepted as 4464&quot;<br>      },<br>      &quot;candidate_expect&quot;: {<br>        &quot;exit_code&quot;: 0,<br>        &quot;stdout_contains&quot;: &quot;PASS reject-out-of-range&quot;<br>      }<br>    }<br>  ]<br>}</pre><p>A few practical tips when writing yours:</p><p>• <strong>For native runs</strong>, replace target with {&quot;kind&quot;: &quot;native&quot;} and swap in your host compiler (cc / gcc). Keep native and ARM32 in two separate manifests.</p><p>• <strong>Make each test a separate process</strong> (tests/unit-tests CASE). If a case triggers a sanitizer abort or fails, you immediately know which case did it.</p><p>• <strong>Turn crashes into clean nonzero exits.</strong> Since a signal (like SIGSEGV or SIGABRT) always counts as an infrastructure error (exit 2), compile with something like -fsanitize=undefined -fno-sanitize-recover=undefined (which exits 1 on UBSan errors) or use an assertion harness that prints a specific failure line and exits 1.</p><p>• <strong>Be picky with</strong> stdout_contains / stderr_contains <strong>markers.</strong> Use a clear diagnostic string like FAIL case-name: ... rather than a generic word like error.</p><h4>Step 3: Run it in CI or locally</h4><pre>targetcheck check --manifest ./arm.json --root ./workspace --output ./out/arm-report</pre><p>Remember that --output must point to a directory that does <strong>not</strong> exist yet, outside both baseline and candidate, and without symlinks in --root or --output parent paths (TargetCheck checks all of that during preflight before executing a single build command).</p><h4>Step 4 (Optional): Call it directly from Go</h4><p>If you’re building release automation or an internal verification pipeline in Go, you don’t even have to shell out to the CLI. github.com/firmdura/targetcheck/pkg/targetcheck has zero third-party dependencies and runs the exact same engine:</p><pre>spec, err := targetcheck.Load(manifestReader)<br>if err != nil {<br>	return err<br>}<br> <br>report, err := targetcheck.Run(ctx, spec, targetcheck.Options{Root: rootDir})<br>if err != nil {<br>	// invalid_input, infrastructure failure, or cancellation<br>	return err<br>}<br> <br>// A behavior mismatch is a result (report.Outcome == targetcheck.OutcomeMismatch), not a Go error.<br>_ = targetcheck.WriteMarkdown(os.Stdout, report)</pre><h3>One quick reality check on scope</h3><p>TargetCheck is intentionally focused, and its docs (docs/limitations.md) are upfront about what it doesn&#39;t do:</p><p>• <strong>It’s not a sandbox.</strong> Your build and test commands run with your user’s permissions, and qemu-arm forwards syscalls to your host kernel. Use a disposable container if you&#39;re testing untrusted code.</p><p>• <strong>It’s not hardware qualification or a full security certification.</strong> User-mode QEMU tests your component binary against a cross sysroot; it doesn’t test kernel drivers, full firmware images, or real board peripherals.</p><p>• <strong>It proves your tests passed on the hashed binaries.</strong> It doesn’t automatically decide whether a CVE applies to your product or guarantee there are no other bugs lurking nearby.</p><p>Within that sweet spot, though, it solves a very real problem: giving embedded engineers a fast, repeatable, architecture-aware sanity check that proves a patch works in the compiled binaries before moving on to heavy image builds and device testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c215ce30360f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beim 103. Durchlauf schlug der libarchive-Test endlich fehl]]></title>
            <link>https://medium.com/@firmdurasecurity/beim-103-durchlauf-schlug-der-libarchive-test-endlich-fehl-a79ffffe72be?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/a79ffffe72be</guid>
            <category><![CDATA[qemu]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[yocto]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 11:38:22 GMT</pubDate>
            <atom:updated>2026-11-22T11:38:22.814Z</atom:updated>
            <content:encoded><![CDATA[<h4>Im öffentlichen Build-Protokoll von Yocto stand genau, wo die Details zu einem sporadischen libarchive-Fehler lagen: in einem temporären Verzeichnis auf dem Buildserver. Von außen war nur „3 failures“ zu sehen. Vor einem Firmware-Update bleibt damit die eigentliche Frage offen: Hat bsdcpio ein beschädigtes Archiv geschrieben, oder hat der Test ein gültiges Archiv verworfen?</h4><p>In <a href="https://github.com/libarchive/libarchive/issues/3816">libarchive#3816</a> hatte Pratik Farkase den Verdacht bereits auf test_option_c eingegrenzt. Der Test legt eine 10-Byte-Datei (1234567890), einen Symlink und ein leeres Verzeichnis an und packt sie in das alte ASCII-Format odc. Ein odc-Header sieht sechs Oktalziffern für Inode-Nummern vor (maximal 262.143), während ext4 regelmäßig größere 32-Bit-Inodes vergibt. Übergroße Inodes hatten zuvor schon einen verwandten cpio-Test scheitern lassen.</p><p>Um im Fehlerfall das Archiv selbst öffnen zu können, ließen wir Yoctos gepackte Testsuite für libarchive 3.8.10 in einer Schleife auf ext4 unter ARM64-QEMU laufen. Die Durchläufe 1 bis 102 liefen fehlerfrei durch. Lauf 103 brach mit genau denselben drei Fehlern wie auf dem Yocto-Server ab und hinterließ das 512 Byte große Archiv. Auf ext4 trug unsere 10-Byte-Datei tatsächlich Inode 327.697, und auch Symlink sowie Verzeichnis lagen über 262.143; ein Blick in die 512 Byte entlastete die Inode-Behandlung jedoch sofort: libarchive hatte den drei Einträgen sauber die synthetischen Nummern 1, 2 und 3 zugewiesen.</p><p>Alle drei Fehlermeldungen stammten stattdessen aus dem Vergleich t &lt;= now in cpio/test/test_option_c.c. Unmittelbar nach dem Anlegen der drei Einträge las der Test die Systemuhr in now ein und wies jeden Archiveintrag mit späterem Zeitstempel zurück. In Lauf 103 stand sowohl auf ext4 als auch im Archiv bei allen drei Einträgen 16:18:45. Eine zusätzliche Diagnoseausgabe erwischte beim nächsten Fehlschlag den Sekundensprung:</p><pre>/* Diagnoselauf auf ext4 (qemuarm64):<br> * Uhrzeit im Test: now = 16:26:32<br> * ext4 &amp; odc:        t = 16:26:33 (Datei, Symlink und Verzeichnis)<br> */<br>- assert(t &lt;= now); /* File wasn&#39;t created in future. */<br>+ assert(t &lt;= now + 1);</pre><p>Alejandro Perez hatte dem <a href="https://github.com/libarchive/libarchive/commit/23de58817c347e2ebffb776ecb46847c7a895988">Test für das neuere Format newc</a> genau diese Sekunde Spielraum bereits eingeräumt. Wir haben die entsprechende Anpassung für odc unter <a href="https://github.com/libarchive/libarchive/pull/3869">libarchive#3869</a> eingereicht und 64 Durchläufe auf ext4 geprüft (32 mit regulären Inodes und 32 verifiziert oberhalb von 262.143, jeweils mit allen 80 Einzelprüfungen). Warum unser gültiges Archiv durchfiel, war damit geklärt; ob auf Yoctos Autobuilder derselbe Sekundensprung zuschlug, zeigen erst die Einzelmeldungen aus dessen temporärem Verzeichnis beim nächsten Fehlschlag.</p><p><a href="https://firmdura.com/de/blog/libarchive-arm64.html">Original im Firmdura-Engineering-Blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a79ffffe72be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Verlorene Patches in BitBake und ein Modbus-Register, das sich trotz Fehlermeldung änderte]]></title>
            <link>https://medium.com/@firmdurasecurity/verlorene-patches-in-bitbake-und-ein-modbus-register-das-sich-trotz-fehlermeldung-%C3%A4nderte-1ce89f785b5c?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ce89f785b5c</guid>
            <category><![CDATA[modbus]]></category>
            <category><![CDATA[firmware]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[industrial-automation]]></category>
            <category><![CDATA[yocto]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 11:38:17 GMT</pubDate>
            <atom:updated>2026-11-22T11:38:17.626Z</atom:updated>
            <content:encoded><![CDATA[<h4>Bei der Prüfung von libmodbus 3.1.7 in einer öffentlichen Yocto-Kirkstone-Konfiguration zeigten sich nacheinander zwei Stellen, an denen ein Build abgesichert wirkt, ohne es zu sein: erst in den BitBake-Metadaten, wo ein Layer-Override stillschweigend drei Upstream-CVE-Patches verwarf, und anschließend in modbus_reply(), wo eine abgewiesene Mask-Write-Anfrage eine Modbus-Exception lieferte, nachdem das Holding-Register bereits überschrieben war.</h4><h3>1. Drei verlorene CVE-Patches durch ein einzelnes = in BitBake</h3><p>Im Kirkstone-Zweig von meta-oe führt libmodbus.inc bereits drei Korrekturen für CVE-2024-10918 auf. Als wir die aufgelösten Rezeptvariablen (bitbake -e libmodbus) mit allen aktiven Board- und Distributions-Layern prüften, fehlten sämtliche Patchdateien in SRC_URI; übrig geblieben war nur ein Git-Repository:</p><pre># meta-oe/recipes-extended/libmodbus/libmodbus.inc<br>SRC_URI = &quot; \<br>    http://libmodbus.org/releases/${BP}.tar.gz \<br>    file://CVE-2024-10918-01.patch \<br>    file://CVE-2024-10918-02.patch \<br>    file://CVE-2024-10918-03.patch \<br>&quot;<br> <br># Nachgelagertes libmodbus_3.1.7.bbappend: &#39;=&#39; ersetzt die gesamte Liste<br>SRC_URI = &quot;git://...;protocol=https;branch=...&quot;</pre><p>Verweist ein .bbappend per SRC_URI = auf einen eigenen Git-Baum, verschwinden alle aus dem Basisrezept geerbten file://-Patches ohne BitBake-Warnung. Nachdem wir die drei CVE-2024-10918-Patches wieder eingebunden hatten, schrieben wir ein lokales C-Testprogramm rund um modbus_reply(), um das Verhalten von 3.1.7 bei fehlerhaften Frames zu prüfen.</p><h3>2. Eine Fehlermeldung nach dem Überschreiben des Holding-Registers</h3><p>Unser Test bestätigte, dass libmodbus 3.1.7 das Holding-Register ändern konnte, bevor eine Fehlermeldung zurückkam.</p><p>In der Steuerungstechnik bedeutet eine Exception-Antwort, dass der angeforderte Schreibzugriff unterblieben ist. Eine Steuerung, die ihren letzten bestätigten Sollwert vorhält, rechnet mit diesem Wert weiter, während der Serverprozess bereits veränderte Bits führt. Da diese Reihenfolge direkt aus libmodbus 3.1.7 stammte, war auch ein unveränderter Kirkstone-Standardbuild mit allen drei meta-oe-Patches betroffen.</p><p>Upstream-Maintainer Stéphane Raimbault hatte die Registerzuweisung in einem neueren Zweig bereits hinter die Längenprüfung gezogen (<a href="https://github.com/stephane/libmodbus/commit/9b99334df2b7c77b9bfeddcdd0e65becfb08d616">Commit 9b99334df2b7</a>). Wir haben diese Änderung auf Kirkstone 3.1.7 zurückportiert, unter ARM64-QEMU sowohl abgewiesene FC22-Zugriffe (Holding-Register unverändert) als auch gültige Bitmasken-Schreibzugriffe über Modbus TCP und Modbus RTU (über gekoppelte Pseudo-Terminals) verifiziert und den Backport unter <a href="https://github.com/garmin/meta-lts-collab/pull/284">garmin/meta-lts-collab#284</a> eingereicht.</p><p><a href="https://firmdura.com/de/blog/libmodbus-kirkstone.html">Original im Firmdura-Engineering-Blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ce89f785b5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beide Images melden libwebsockets 4.2.2: warum Versions-Scans vor und nach einem Backport scheitern]]></title>
            <link>https://medium.com/@firmdurasecurity/beide-images-melden-libwebsockets-4-2-2-warum-versions-scans-vor-und-nach-einem-backport-scheitern-1b69ea6641c8?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b69ea6641c8</guid>
            <category><![CDATA[firmware-security]]></category>
            <category><![CDATA[yocto]]></category>
            <category><![CDATA[sbom]]></category>
            <category><![CDATA[software-supply-chain]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 11:37:15 GMT</pubDate>
            <atom:updated>2026-11-22T11:37:15.757Z</atom:updated>
            <content:encoded><![CDATA[<h4>Firmware-Teams sollen eine SBOM vor der Freigabe scannen und nach dem Einspielen von Sicherheitspatches erneut prüfen. Bei unserem Yocto-Kirkstone-Referenzbuild für libwebsockets 4.2.2 versagte dieser Ablauf an beiden Enden: Grype übersah einen Heap-Überlauf im HTTP/2-Server des ungepatchten Images, und das gepatchte Image trug exakt dieselbe Upstream-Versionsnummer weiter.</h4><p>Unter Yocto Kirkstone (Poky 4.0.35) baut meta-openembedded libwebsockets 4.2.2 standardmäßig mit aktiviertem HTTP/2-Server in PACKAGECONFIG. Maher Azzouzi fand dort gemeinsam mit der Zero Day Initiative CVE-2026-19773: einen serverseitigen Schreibzugriff hinter das Pufferende in lws_frag_append() beim Dekodieren von HTTP/2-:path-Headern, noch bevor Anwendungscode die Anfrage überhaupt sieht. Statt bestehende Kirkstone-Geräte auf 4.5.x zu heben und abhängige Dienste neu zu qualifizieren, haben wir Andy Greens Grenzprüfung (Commit 824151862f37) sowie Feng Xues Ergänzung für URI-Parameter (0c6cef0922c5) auf 4.2.2 zurückportiert und zwei ARM64-QEMU-Images gebaut.</p><h3>Paketversion (PV / PR)</h3><p><strong>Ungepatchtes Image</strong> 4.2.2 (r0)</p><p><strong>Gepatchtes Image</strong> 4.2.2 (r0.firmdura1)</p><h3>Standard-Grype 0.122.0 (DB 18. Nov. 2026)</h3><p><strong>Ungepatchtes Image</strong> 151 andere Treffer, 0 für CVE-2026-19773</p><p><strong>Gepatchtes Image</strong> 151 andere Treffer, 0 für CVE-2026-19773</p><h3>ARM64-QEMU-Grenztests für HTTP/2-:path</h3><p><strong>Ungepatchtes Image</strong> 7/7 Pufferschreibfehler reproduziert (exit 1)</p><p><strong>Gepatchtes Image</strong> 7/7 sauber abgewiesen; Folgeanfrage liefert HTTP 200 (exit 0)</p><h3>Rootfs-SHA-256 &amp; OpenVEX-Status</h3><p><strong>Ungepatchtes Image</strong> 6f18018f… (affected)</p><p><strong>Gepatchtes Image</strong> 92a3d9f9… (fixed)</p><p>Der erste blinde Fleck zeigte sich vor jeder Codeänderung. Grype 0.122.0 mit der Anchore-Datenbank v6.1.10 vom 18. November 2026 las unsere SPDX-2.2-SBOM mit 41 Paketen ein, erkannte libwebsockets 4.2.2 und meldete 151 Treffer in anderen Paketen, aber keinen einzigen für CVE-2026-19773. Die Datenbank enthielt zwar distributionsspezifische Einträge, doch in der NIST NVD stand die Schwachstelle noch auf Awaiting Analysis, sodass generische CPE-Einträge für unser Yocto-Paket fehlten. Wer sämtliche 151 Meldungen abgearbeitet hätte, hätte den HTTP/2-Überlauf im Image behalten.</p><p>Der Start beider Images unter qemu-system-aarch64 -nic none samt Prüfung der geladenen Bibliothek /usr/lib/libwebsockets.so.18 zeigte die zweite Falle: Reine Gutfalltests unterscheiden einen vollständigen Sicherheits-Backport nicht von einem lückenhaften. Auf reguläre HTTP/2-Anfragen antworteten beide Images mit HTTP 200. Als Gegenprobe für unsere Testsuite bauten wir zwei absichtlich unvollständige Backports; beide bestanden gewöhnliche HTTP-200-Prüfungen und fielen erst bei den sieben Grenztests durch.</p><p>Ist der Backport verifiziert, erzeugt ein pauschaler VEX-Eintrag nach dem Muster „libwebsockets 4.2.2 ist behoben“ das umgekehrte Problem, weil er künftige Warnungen auch für ungepatchte 4.2.2-Builds unterdrückt. Erst die Bindung unseres OpenVEX-0.2.0-Nachweises an die SHA-256-Produkt-PURL des jeweiligen .rootfs.ext4-Images trennte beide Stände sauber: Gegen eine isolierte CPE-Testdatenbank blendete Grype alle drei Pakettreffer zu CVE-2026-19773 auf dem gepatchten Image aus und ließ sie auf dem ungepatchten Image bestehen. Beide QEMU-Evaluierungspakete und der Layer sind im <a href="https://github.com/firmdura/meta-firmdura-kirkstone/releases/tag/v0.1.0">Kirkstone-Referenzrelease v0.1.0</a> veröffentlicht; der Rezept-Backport liegt unter <a href="https://github.com/garmin/meta-lts-collab/pull/283">garmin/meta-lts-collab#283</a> vor.</p><p><a href="https://firmdura.com/de/blog/libwebsockets-kirkstone.html">Original im Firmdura-Engineering-Blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b69ea6641c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wie der Backport von GNU Wget auf 32-Bit-ARM einen eigenen Upstream-Fehler aufdeckte]]></title>
            <link>https://medium.com/@firmdurasecurity/wie-der-backport-von-gnu-wget-auf-32-bit-arm-einen-eigenen-upstream-fehler-aufdeckte-8d12e358ca35?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d12e358ca35</guid>
            <category><![CDATA[arm]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[c-programming-language]]></category>
            <category><![CDATA[yocto]]></category>
            <category><![CDATA[firmware]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 12:13:32 GMT</pubDate>
            <atom:updated>2026-11-21T12:13:32.887Z</atom:updated>
            <content:encoded><![CDATA[<h4>Update-Skripte und Telemetrie-Dienste prüfen in der Regel Wgets Exit-Code, bevor sie einer heruntergeladenen Datei vertrauen. Beim Backport von CVE-2026-58470 auf GNU Wget 1.21.4 für ein 32-Bit-ARM-Gateway stießen wir erst auf einen long-Überlauf oberhalb von 2 GiB und danach im Upstream-Code auf einen Randfall, bei dem eine HTTP-206-Antwort null Byte auf den Speicher schrieb und trotzdem Status 0 lieferte.</h4><p>Vor jeder Änderung an src/http.c stellten wir sicher, dass unser Ausgangsbaum exakt dem öffentlich verfügbaren Yocto-Scarthgap-Image eines 32-Bit-ARM-Gateways (Cortex-A5) entsprach. Das Rezept baute GNU Wget 1.21.4 bereits mit zwei älteren CVE-Patches. Das wget-Binary aus dem Hersteller-SDK stimmte Byte für Byte mit dem Firmware-Image überein, und mit den beiden Rezept-Patches ergab sich exakt jene http.c-Fassung, die in den Debug-Quellen des SDKs lag.</p><h3>Wenn long 32 Bit breit ist, Dateioffsets aber 64 Bit</h3><p>CVE-2026-58470 betrifft parse_content_range(), also den Parser für fortgesetzte Downloads (wget -c). Der erste Upstream-Commit (<a href="https://gitlab.com/gnuwget/wget/-/commit/43d3ba9336bc94937e6fae2365c6ffd30c34ffcf">43d3ba9336bc</a>) ersetzte eine ungeschützte Ziffernschleife durch strtol(). Auf unserem 64-Bit-x86_64-Buildrechner sind sowohl long als auch Wgets Dateioffset-Typ wgint 64 Bit breit, sodass mehrere Gigabyte große Transfers unauffällig durchliefen. Für 32-Bit-ARM kompiliert und unter QEMU mit den SDK-Bibliotheken des Gateways gestartet, schlugen die Bereichstests jedoch ab 2 GiB fehl:</p><pre>/* Erster Upstream-Fix (43d3ba9336bc): 32-Bit-long auf ARM32 setzt ab 2 GiB ERANGE */<br>num = strtol(hdr, &amp;end, 10);<br> <br>/* Folge-Commit (01ff771caac1): 64-Bit-Konvertierung passend zu wgint */<br>num = strtoll(hdr, &amp;end, 10);</pre><p>Auch auf 32-Bit-ARM wird Wget mit Large-File-Support (64-Bit-off_t) gebaut. Ein 3-GiB-Archiv lässt sich problemlos speichern, bis ein Verbindungsabbruch parse_content_range() zwingt, die Byteposition über ein 32-Bit-long einzulesen. Der Backport von Tim Rühsens Folge-Commit <a href="https://gitlab.com/gnuwget/wget/-/commit/01ff771caac1958662ca8665eed2021ec386a7af">01ff771caac1</a> stellte den vollen 64-Bit-Wertebereich auf ARM wieder her.</p><h3>Die Obergrenze um eins verfehlt: null geschriebene Byte</h3><p>Mit der zusätzlichen WGINT_MAX-Prüfung, 19 Grenzfalltests für den Parser und einem HTTP-206-Integrationstest samt Inhaltsvergleich waren beide Pfade abgesichert. Auf dem Scarthgap-Stand 1.21.4 (<a href="https://firmdura.com/de/case-study.html">dokumentiert in unserer Fallstudie</a>) bestanden alle 15 Unit-Testgruppen auf dem Host unter UBSan sowie auf 32-Bit-ARM unter QEMU, ebenso alle vier lokalen Download- und Resume-Tests. Jabar Asadi hat die Parserprüfung samt Sechs-Byte-Regressionstest in <a href="https://gitlab.com/gnuwget/wget/-/merge_requests/89">GNU Wget Merge Request !89</a> eingereicht.</p><p><a href="https://firmdura.com/de/blog/wget-arm32.html">Original im Firmdura-Engineering-Blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d12e358ca35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On run 103, the libarchive test finally failed]]></title>
            <link>https://medium.com/@firmdurasecurity/on-run-103-the-libarchive-test-finally-failed-3e7f45e4f8f7?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e7f45e4f8f7</guid>
            <category><![CDATA[yocto]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[qemu]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 11:25:09 GMT</pubDate>
            <atom:updated>2026-11-21T11:25:09.811Z</atom:updated>
            <content:encoded><![CDATA[<h4>Yocto’s public build log told us right where to find the details of an intermittent libarchive failure: inside a temporary directory on the build server. From the outside, all anyone could see was “3 failures.” Before shipping that library in a firmware update, you want to know whether bsdcpio wrote a corrupt archive or whether the test rejected a good one.</h4><p>In <a href="https://github.com/libarchive/libarchive/issues/3816">libarchive#3816</a>, Pratik Farkase had already narrowed the suspect down to test_option_c, which packs a 10-byte file (1234567890), a symlink, and an empty directory into the legacy ASCII odc cpio format. An odc header only has six octal digits for an inode number (a ceiling of 262,143), whereas ext4 routinely assigns larger 32-bit inodes. Oversized inodes had tripped up a sibling cpio test before.</p><p>To capture a failing archive we could open ourselves, we ran Yocto’s packaged test suite for libarchive 3.8.10 in a loop on ext4 under ARM64 QEMU. Runs 1 through 102 passed. Run 103 failed with the same three-error count as Yocto and left the 512-byte archive behind. On ext4, our 10-byte file did have inode 327,697, and the symlink and directory were over 262,143 as well, yet opening the 512 bytes exonerated the inode logic right away: libarchive had cleanly remapped the three entries to synthetic serials 1, 2, and 3.</p><p>All three failures came instead from t &lt;= now in cpio/test/test_option_c.c. Right after creating the three filesystem entries, the test sampled the wall clock into now and rejected any archive header with a newer modification time. On run 103, both ext4 and the archive recorded 16:18:45 across all three entries. Instrumenting the test to print both sides caught the one-second tick on the next failure:</p><pre>/* Diagnostic run on ext4 (qemuarm64):<br> * test clock: now = 16:26:32<br> * ext4 &amp; odc:   t = 16:26:33 (file, symlink, and directory)<br> */<br>- assert(t &lt;= now); /* File wasn&#39;t created in future. */<br>+ assert(t &lt;= now + 1);</pre><p>Alejandro Perez had already given the <a href="https://github.com/libarchive/libarchive/commit/23de58817c347e2ebffb776ecb46847c7a895988">newer newc format test</a> that same one-second allowance. We submitted the matching change for odc in <a href="https://github.com/libarchive/libarchive/pull/3869">libarchive#3869</a> and ran 64 passes on ext4 (32 with ordinary inodes and 32 verified above 262,143, all 80 checks passing on each run). That settled why a valid archive failed our local runs; whether Yocto’s autobuilder hit the exact same clock tick still awaits the per-line assertions from its temporary directory on the next failure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e7f45e4f8f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dropped patches in BitBake and a Modbus register that changed after an error]]></title>
            <link>https://medium.com/@firmdurasecurity/dropped-patches-in-bitbake-and-a-modbus-register-that-changed-after-an-error-e57a05dc4bad?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/e57a05dc4bad</guid>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[firmware]]></category>
            <category><![CDATA[modbus]]></category>
            <category><![CDATA[industrial-automation]]></category>
            <category><![CDATA[yocto]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 11:24:45 GMT</pubDate>
            <atom:updated>2026-11-21T11:24:45.840Z</atom:updated>
            <content:encoded><![CDATA[<h4>Auditing libmodbus 3.1.7 in a public Yocto Kirkstone configuration turned up two separate ways a build can look protected when it is not: first in BitBake metadata, where a layer override silently dropped three upstream CVE patches, and then in modbus_reply(), where a rejected mask-write request returned a Modbus exception after overwriting the holding register.</h4><h3>1. Losing three CVE patches to a single = in BitBake</h3><p>Upstream meta-oe on Kirkstone already lists three fixes for CVE-2024-10918 in libmodbus.inc. When we inspected the resolved recipe variables (bitbake -e libmodbus) with every board and distribution layer enabled, all three patch files had vanished from SRC_URI, leaving only a Git repository:</p><pre># meta-oe/recipes-extended/libmodbus/libmodbus.inc<br>SRC_URI = &quot; \<br>    http://libmodbus.org/releases/${BP}.tar.gz \<br>    file://CVE-2024-10918-01.patch \<br>    file://CVE-2024-10918-02.patch \<br>    file://CVE-2024-10918-03.patch \<br>&quot;<br> <br># Downstream libmodbus_3.1.7.bbappend: &#39;=&#39; overwrites the whole list<br>SRC_URI = &quot;git://...;protocol=https;branch=...&quot;</pre><p>Pointing a .bbappend at a custom Git tree with SRC_URI = wipes every file:// security patch inherited from the base recipe without raising a BitBake warning. Restoring the three CVE-2024-10918 patches closed that configuration gap, and we wrote a local C regression fixture around modbus_reply() to verify how 3.1.7 handled malformed frames.</p><h3>2. Returning an exception after changing a holding register</h3><p>Our test confirmed that libmodbus 3.1.7 could change a holding register before returning an exception.</p><p>In industrial control, an exception reply tells the caller that the requested write did not happen. A controller that caches its last confirmed setpoint keeps operating on that value while the server holds mutated bits. Because that ordering lived in libmodbus 3.1.7 itself, even a stock Kirkstone build with all three meta-oe patches intact remained exposed.</p><p>Upstream maintainer Stéphane Raimbault had already moved the register update past the length check in a newer branch (<a href="https://github.com/stephane/libmodbus/commit/9b99334df2b7c77b9bfeddcdd0e65becfb08d616">commit 9b99334df2b7</a>). We backported that change to Kirkstone 3.1.7, verified on ARM64 QEMU that rejected FC22 writes left 0x5678 untouched while valid mask writes updated only the selected bits over both Modbus TCP and Modbus RTU (across paired pseudo-terminals), and submitted the backport in <a href="https://github.com/garmin/meta-lts-collab/pull/284">garmin/meta-lts-collab#284</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e57a05dc4bad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Both images report libwebsockets 4.2.2: why version scans fail before and after a backport]]></title>
            <link>https://medium.com/@firmdurasecurity/both-images-report-libwebsockets-4-2-2-why-version-scans-fail-before-and-after-a-backport-a6f70d031a3b?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6f70d031a3b</guid>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[software-supply-chain]]></category>
            <category><![CDATA[firmware-security]]></category>
            <category><![CDATA[sbom]]></category>
            <category><![CDATA[yocto]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 11:23:56 GMT</pubDate>
            <atom:updated>2026-11-21T11:23:56.362Z</atom:updated>
            <content:encoded><![CDATA[<h4>Firmware teams are routinely asked to scan an SBOM before a release and scan it again after patching. On our Yocto Kirkstone reference build for libwebsockets 4.2.2, that workflow broke at both ends: Grype missed an HTTP/2 heap overflow on the unpatched image, and the patched image kept the exact same upstream version string.</h4><p>On Yocto Kirkstone (Poky 4.0.35), meta-openembedded builds libwebsockets 4.2.2 with the HTTP/2 server enabled in the default PACKAGECONFIG. Maher Azzouzi, working with the Zero Day Initiative, found CVE-2026-19773: a server-side heap out-of-bounds write in lws_frag_append() while decoding HTTP/2 :path headers, reachable before application code handles the request. Rather than bumping fielded Kirkstone builds to 4.5.x and re-qualifying dependent services, we backported Andy Green’s bounds check (commit 824151862f37) and Feng Xue’s URI-argument follow-up (0c6cef0922c5) onto 4.2.2 and built paired ARM64 QEMU images.</p><h3>Baseline and patched images</h3><p><strong>Package version (PV / PR).</strong> The baseline reported 4.2.2 (r0) and the patched image reported 4.2.2 (r0.firmdura1).</p><p><strong>Stock Grype 0.122.0 (DB 18 Nov 2026).</strong> Each image returned 151 unrelated hits and zero for CVE-2026-19773.</p><p><strong>ARM64 QEMU HTTP/2 boundary suite.</strong> The baseline showed out-of-bounds writes in 7/7 cases (exit 1). The patched image rejected all seven cases cleanly and returned HTTP 200 on the next request (exit 0).</p><p><strong>Rootfs SHA-256 and OpenVEX status.</strong> The baseline hash began 6f18018f… (affected). The patched image hash began 92a3d9f9… (fixed).</p><p>The first blind spot showed up before we applied a single line of C. Grype 0.122.0 with Anchore database v6.1.10 (18 November 2026) read our 41-package SPDX 2.2 SBOM, saw libwebsockets 4.2.2, and returned 151 matches elsewhere in the image, yet zero for CVE-2026-19773. The database already carried distribution-specific rows for the bug, while NIST NVD still listed the CVE as Awaiting Analysis, leaving zero generic CPE rows to match our Yocto package. Working down all 151 scanner rows would have left the HTTP/2 server overflow untouched.</p><p>Booting both images in qemu-system-aarch64 -nic none and checking the loaded /usr/lib/libwebsockets.so.18 binary exposed the second trap: ordinary functional tests cannot tell a complete security backport from a broken one. Both images returned HTTP 200 on normal HTTP/2 traffic. To test the test harness itself, we also built two deliberately incomplete backports; both passed normal HTTP 200 smoke checks, and both were caught by the seven boundary cases.</p><p>Once a backport passes, recording a blanket VEX claim that “libwebsockets 4.2.2 is fixed” creates the reverse failure by silencing future alerts on unpatched 4.2.2 builds. Binding our OpenVEX 0.2.0 statement to the .rootfs.ext4 SHA-256 product PURL avoided that collision: tested against an isolated CPE fixture database, Grype suppressed all three CVE-2026-19773 package matches on the patched image while keeping all three active on the baseline image. Both QEMU evaluation bundles and the layer source are published in <a href="https://github.com/firmdura/meta-firmdura-kirkstone/releases/tag/v0.1.0">our Kirkstone v0.1.0 reference release</a>, and we submitted the recipe patch in <a href="https://github.com/garmin/meta-lts-collab/pull/283">garmin/meta-lts-collab#283</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6f70d031a3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backporting GNU Wget to 32-bit ARM uncovered an upstream bug of its own]]></title>
            <link>https://medium.com/@firmdurasecurity/backporting-gnu-wget-to-32-bit-arm-uncovered-an-upstream-bug-of-its-own-712131eee15f?source=rss-01e5d3768d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/712131eee15f</guid>
            <category><![CDATA[arm]]></category>
            <category><![CDATA[yocto]]></category>
            <category><![CDATA[firmware]]></category>
            <category><![CDATA[c-programming]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <dc:creator><![CDATA[Firmdura]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 11:21:38 GMT</pubDate>
            <atom:updated>2026-11-21T11:21:38.849Z</atom:updated>
            <content:encoded><![CDATA[<h4>Update scripts and field-telemetry jobs usually check Wget’s exit code before trusting a downloaded file. While backporting CVE-2026-58470 to GNU Wget 1.21.4 for a 32-bit ARM gateway, we hit a long truncation past 2 GiB and then uncovered a separate upstream parser bug where an HTTP 206 Partial Content reply wrote zero bytes to disk and exited 0.</h4><p>Before touching src/http.c, we verified the exact source tree shipped in a public Yocto Scarthgap firmware image for a 32-bit ARM Cortex-A5 gateway. The recipe built GNU Wget 1.21.4 on top of two earlier CVE patches. Comparing the firmware’s wget binary against the vendor SDK confirmed a byte-for-byte match, and applying the recipe’s existing patches reproduced the exact http.c packaged in the SDK’s debug sources.</p><h3>When long is 32 bits and file offsets are 64</h3><p>CVE-2026-58470 sits in parse_content_range(), the parser Wget runs when resuming an interrupted download (wget -c). Upstream commit <a href="https://gitlab.com/gnuwget/wget/-/commit/43d3ba9336bc94937e6fae2365c6ffd30c34ffcf">43d3ba9336bc</a> replaced an unchecked decimal loop with strtol(). On a 64-bit x86_64 build host, both long and Wget’s wgint file-offset type are 64 bits wide, so multi-gigabyte offsets pass without trouble. Cross-compiled for 32-bit ARM and run under QEMU user mode with the gateway’s SDK libraries, Wget’s range unit tests failed on any offset above 2 GiB:</p><pre>/* First upstream commit (43d3ba9336bc): 32-bit long on ARM32 sets ERANGE above 2 GiB */<br>num = strtol(hdr, &amp;end, 10);<br> <br>/* Follow-up commit (01ff771caac1): 64-bit conversion matching wgint */<br>num = strtoll(hdr, &amp;end, 10);</pre><p>Even on 32-bit ARM, Wget builds with large-file support (64-bit off_t), so saving a 3 GiB archive works until a dropped link forces parse_content_range() to read the byte position back through a 32-bit long. Backporting Tim Rühsen’s follow-up commit <a href="https://gitlab.com/gnuwget/wget/-/commit/01ff771caac1958662ca8665eed2021ec386a7af">01ff771caac1</a> restored the full 64-bit range on ARM.</p><h3>The off-by-one ceiling that wrote zero bytes</h3><p>Rejecting last_byte_ptr == WGINT_MAX, adding 19 boundary parser cases, and asserting saved file contents in an HTTP 206 test closed that gap. On the Scarthgap 1.21.4 series (<a href="https://firmdura.com/case-study.html">walked through in our case study</a>), all 15 unit-test groups passed on the host under UBSan and on 32-bit ARM under QEMU, alongside all four localhost download and resume tests. Jabar Asadi submitted the parser check and six-byte regression test upstream in <a href="https://gitlab.com/gnuwget/wget/-/merge_requests/89">GNU Wget merge request !89</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=712131eee15f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>