Kernel crash when the Terminal reads a very large file with wc, head or tail
KSA-2026-0007
- Status
- Resolved
- Severity
- Medium
- Affected versions
- No released version (development code from before 0.2.0)
- Fixed in
- 0.2.0
- Published
- 2026-11-02
- Updated
- 2026-11-02
Summary
The Terminal's wc, head and tail commands read the whole file into one memory block without checking that the allocation worked. A file bigger than free memory, or one with a false size on a crafted drive, crashed the system.
The commands now read in pieces and check every allocation. This was found and fixed before the first public release.
Credit
Brent Gordon