Commit 4bf4dd9
committed
u-boot: v2026.04: btrfs zstd: reject short decode
Per CodeRabbit review on PR armbian#9675:
zstd_decompress_dctx() returns a size_t — the actual number of
bytes written, not just an error indicator. The previous code
unconditionally returned dlen even if ret < dlen, leaving the
tail of dbuf as uninitialised garbage.
In practice this path is unreachable for well-formed BTRFS extents:
after our fix out_len = max(dlen, fcs), and on success zstd produces
exactly fcs bytes, so ret == fcs >= dlen. But the defensive check
is trivial and guards against:
- a frame header with a falsified content-size that still passes
the integrity check;
- truncated/corrupted frames that zstd does not always flag as an
error.
Apply the same fix to the duplicate patch under board_helios64/.
This issue was not flagged in PR armbian#9651 (v2026.01) — different
review pass surfaced different findings.1 parent 2b72b23 commit 4bf4dd9
2 files changed
Lines changed: 2 additions & 2 deletions
File tree
- patch/u-boot/v2026.04
- board_helios64
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
0 commit comments