Skip to content

Upgrade to Zephyr 4.4.2 and bump mbedtls, tf-psa-crypto, fatfs - #516

Open
nateinaction wants to merge 3 commits into
mainfrom
upgrade/zephyr-4.4.2
Open

Upgrade to Zephyr 4.4.2 and bump mbedtls, tf-psa-crypto, fatfs#516
nateinaction wants to merge 3 commits into
mainfrom
upgrade/zephyr-4.4.2

Conversation

@nateinaction

@nateinaction nateinaction commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Bumps the west manifest and the lib/zephyr-workspace/zephyr submodule from v4.4.1 to v4.4.2, a 197-commit security and bugfix release on the v4.4 branch, then moves three module pins.

Three commits, reviewable independently.

1. Zephyr 4.4.2

Of the ten modules this trimmed manifest imports, none of their revisions moved between the two tags — the only change in upstream's west.yml is hal_espressif, which we don't import. So the upgrade itself is one manifest line plus the submodule pointer.

4.4.2 includes c219dde148e modules: mcuboot: kconfig: Fix RAM revert image confirmed image, which touches OTA swap logic. Given this repo's history with swap behavior, that's the piece worth exercising on hardware.

2. mbedtls + tf-psa-crypto → Mbed TLS 4.1.1 / TF-PSA-Crypto 1.1.1

These are the revisions Zephyr's v4.4-branch moved to after tagging 4.4.2 — the only module movement on the stable branch, so this is what 4.4.3 will ship. Taking it now keeps us on the tested combination rather than ahead of it.

TF-PSA-Crypto 1.1.1 carries six CVEs, but none reach either image as configured, so this is housekeeping rather than an urgent fix. The application enables only HMAC and SHA-256 (prj.conf:94-96); the bootloader only RSA-PSS verify with SHA-256. The CVEs are in RSA PKCS#1 v1.5 decryption, RSA key generation, ChaCha20, x25519/Everest ECDH, ECC scalar multiplication, and ECC public-key parsing — no ECC, no ChaCha, no private-key operations, no on-device keygen. Image sizes are unchanged, consistent with that analysis.

3. fatfs → 4f60a12c (ahead of the manifest)

This one is a deliberate divergence and the reason it's worth merging now rather than waiting.

Five FatFs CVEs were fixed in July 2026 but did not make 4.4.2, and are not on v4.4-branch — 4.4.3 won't pick them up either. Our pin dates to October 2025 and is a pristine ChaN R0.16 with none of them applied (verified: MIN_EXFAT, MIN_VOLUME, fill_zero all absent).

Three are mount-time validation, and the flight filesystem is FAT with exFAT enabled:

CVE Defect
2026-6682 BPB_FATSz32 × FAT count overflowed a DWORD, laying the data region inside the FAT
2026-6683 (exFAT) BPB reporting zero clusters → sync_fs() divides by zero on first write or unmount
2026-6687 (exFAT) f_getlabel() looped over an unvalidated on-disk count, overrunning the caller's buffer

The realistic trigger here isn't an attacker-supplied volume — it's a superblock torn by a hard reset, the same corruption class that motivated the boot-count hardening in #470. Today a malformed BPB faults; with these patches it's rejected at mount, and CONFIG_FS_FATFS_MOUNT_MKFS=y reformats and recovers.

A fourth, CVE-2026-6686, zeroes the range exposed when f_lseek() extends a file past EOF, which previously read back stale flash contents. The fifth (CVE-2026-6685) upstream documents as a readability change, not a fix.

The six commits touch only ff.c and docs, so there's no Zephyr-side glue to adapt.

Verification

  • west update — all projects at their expected revisions
  • make build — clean. Application FLASH 64.70% (675,560 B, +280 B from fatfs fill_zero), RAM 56.70% (unchanged)
  • make check-console-disabled — OK, console still off so the downlink stays frames-only
  • make build-mcuboot — clean. Bootloader FLASH 8.96% (93,516 B), RAM 8.97%

Still to do before this leaves draft

  • Bench run of the OTA swap test, given the MCUboot Kconfig fix in 4.4.2
  • Full integration suite on hardware, with attention to filesystem mount/format paths given the fatfs change

Bump the west manifest and the lib/zephyr-workspace/zephyr submodule from
v4.4.1 to v4.4.2, a 197-commit security and bugfix release on the v4.4
branch.

No module pins change. The only revision that moved in upstream's
west.yml between the tags is hal_espressif, which this trimmed manifest
does not import; all ten modules we do pin (cmsis, cmsis_6,
hal_rpi_pico, hal_st, picolibc, mbedtls, tf-psa-crypto, mcuboot, fatfs,
loramac-node) still match v4.4.2's manifest exactly.

Of note for this deployment, 4.4.2 carries a MCUboot Kconfig fix for the
RAM-revert confirmed-image path (c219dde148e), which touches the OTA
swap logic.

Builds: make build and make build-mcuboot both clean, console still
disabled. Bootloader flash 7.30%, RAM 3.31%.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 309a0409-d967-4b0e-8312-64e1ae82d492

📥 Commits

Reviewing files that changed from the base of the PR and between a477893 and b26ca4b.

📒 Files selected for processing (2)
  • lib/zephyr-workspace/zephyr
  • west.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Updates
    • Updated the underlying Zephyr platform to version 4.4.2 for improved stability and compatibility.
    • Refreshed security and storage components, including mbedTLS, TF-PSA-Crypto, and FatFs.
    • Incorporated the latest Zephyr workspace revisions.
  • Compatibility
    • Includes upstream platform updates while preserving existing application-facing interfaces.

Walkthrough

The change updates the Zephyr subproject pointer and west manifest revisions for Zephyr, mbedTLS, TF-PSA-Crypto, and FatFs.

Changes

Zephyr dependency updates

Layer / File(s) Summary
Align Zephyr dependency revisions
west.yml, lib/zephyr-workspace/zephyr
The Zephyr revision advances from v4.4.1 to v4.4.2. The Zephyr subproject pointer advances to commit dccb09599635bdff17633fa7e9dab014b91dce90. The mbedTLS, TF-PSA-Crypto, and FatFs revisions also advance.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to b26ca

This change updates Zephyr and related dependency versions without introducing an identified merge-blocking correctness or production risk; no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checks the manifest with care
New Zephyr commits hop through the air
mbedTLS and FatFs follow the trail
Crypto revisions raise every sail
The workspace points to versions bright

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: upgrading Zephyr to 4.4.2 and updating the mbedtls, tf-psa-crypto, and fatfs revisions.
Description check ✅ Passed The description provides a detailed change summary, explains the rationale for each dependency update, documents verification results, and identifies the remaining OTA swap test. It does not reproduce…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides a detailed change summary, explains the rationale for each dependency update, documents verification results, and identifies the remaining OTA swap test. It does not reproduce all template sections, such as related issues and the checklist, but the core required information is present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Take Mbed TLS 4.1.1 and TF-PSA-Crypto 1.1.1, the revisions Zephyr's
v4.4-branch already moved to after tagging 4.4.2. This is the only module
movement on the stable branch, so it is what 4.4.3 will ship; taking it
now keeps us on the tested combination rather than ahead of it.

TF-PSA-Crypto 1.1.1 carries six CVEs. None reach either image as
configured, so this is not an urgent fix:

- CVE-2026-50587 (RSA PKCS#1 v1.5 decryption side channel), RSA key
  generation timing: we do no private-key operations and generate no keys
  on device. MCUboot verifies with an RSA-2048 public key under PSS.
- CVE-2026-50584 (ChaCha20 counter wrap), CVE-2026-54434 (x25519 Everest
  low-order point): neither primitive is enabled.
- CVE-2026-54435 (ECC scalar multiplication side channel),
  CVE-2026-50583 (1-byte overread parsing a malformed ECC public key):
  no ECC is compiled in. The application enables only HMAC and SHA-256
  (prj.conf), the bootloader only RSA-PSS verify and SHA-256.

Sizes are unchanged in both images, consistent with the changed code
sitting entirely in paths we do not compile.
Unlike the crypto bump, this moves fatfs off the revision Zephyr 4.4.2
pins. The fixes landed in the Zephyr FatFs tree in July 2026 but did not
make the 4.4.2 release and are not on v4.4-branch, so waiting for 4.4.3
would not pick them up. Our previous pin dates to October 2025 and is a
pristine ChaN R0.16 with none of them applied.

Three are mount-time validation, which is the reason to take this. The
flight filesystem is FAT with exFAT enabled (prj.conf), and the realistic
trigger here is not an attacker-supplied volume but a superblock torn by
a hard reset -- the same corruption class that motivated the boot count
hardening in #470. Today a malformed BPB faults; with these it is
rejected at mount, and CONFIG_FS_FATFS_MOUNT_MKFS reformats and recovers.

- CVE-2026-6682: BPB_FATSz32 times the FAT count overflowed a DWORD,
  laying the data region inside the FAT. Now capped before the multiply.
- CVE-2026-6683 (exFAT): a BPB reporting zero clusters made sync_fs()
  divide by zero on first write or unmount. Rejected at mount instead.
- CVE-2026-6687 (exFAT): f_getlabel() looped over an unvalidated on-disk
  count and overran the caller's buffer. Clamped to the 11-char maximum.

The fourth, CVE-2026-6686, zeroes the range exposed when f_lseek()
extends a file past end-of-file; that range previously read back stale
flash contents. The fifth, CVE-2026-6685, upstream documents as a
readability change rather than a real fix.

The six commits touch only ff.c and documentation, so there is no
Zephyr-side glue to adapt. Costs 280 bytes of flash (64.67% -> 64.70%)
for the fill_zero helper; RAM is unchanged.
@nateinaction nateinaction changed the title Upgrade to Zephyr 4.4.2 Upgrade to Zephyr 4.4.2 and bump mbedtls, tf-psa-crypto, fatfs Aug 31, 2026
@nateinaction
nateinaction marked this pull request as ready for review August 31, 2026 14:50
@nateinaction
nateinaction enabled auto-merge (squash) August 31, 2026 14:51
@Mikefly123
Mikefly123 self-requested a review September 2, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant