Kernel panic via unvalidated on-disk leaf->data_len used as getblk() size in hammer_io_direct_uncache_callback
| Field | Value |
|---|---|
| ID | DF-3033 |
| Status | new |
| Severity | Low |
| CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:L |
| CWE | CWE-20 / CWE-1287 |
| File | sys/vfs/hammer/hammer_io.c |
| Lines | 1948-1962 (leaf source: hammer_reblock.c:342-346) |
| Area | vfs/hammer |
| Confidence | certain |
| Discovered | 2026-09-02 |
| Pass | 2 (GLM 5.3 second pass) |
| Bucket | base:vfs |
| Reported | pending |
| Known CVE | none |
| CVE match | novel |
Summary
hammer_io_direct_uncache_callback() takes data_len straight from an on-disk B-Tree leaf and passes it to getblk() as the buffer size with only an INVARIANTS-only KKASSERT on alignment. getblk() contains an unconditional panic('getblk: size(%d) > MAXBSIZE(%d)') for size > 64K. A crafted HAMMER filesystem image containing a large-data DATA record with data_len > 64K (node CRC forged β the image author fully controls it) causes a kernel panic when the reblocker processes that record after the file data was read (the findblk/bio2-cache gate requires a prior read of the file). file_offset = key β data_len can likewise underflow to an arbitrary getblk loffset. Local DoS (kernel panic) from a crafted HAMMER1 image; precondition: root mounts the crafted image and runs 'hammer reblock' (root-only ioctl) after the target file has been read β not reachable unprivileged on a stock system. Impact ceiling is a voluntary panic; no memory corruption, no info leak β the size is used only as a buffer-cache key/size. Not built/run (Low, privileged preconditions per conditional-verify contract). Fix: validate the leaf at the single entry point in hammer_io_direct_uncache (row diff).
Timeline
- 2026-09-02 Discovered during pass-2 audit of hammer_io.c (GLM 5.3). DF-0792 re-verified, not re-reported.
No comments yet.