# What happened
Linux received a fix for a silent, user-space data loss bug that first appeared in July 2023 and affected kernels distributed since Linux 6.6. The change was merged soon after the Linux 7.3-rc3 release as part of an x86/urgent merge. The patch itself is small — a single-line code change — but addresses a condition that in some production workloads caused writes to be lost without reporting errors.
# Conditions that trigger the bug
The issue required a specific combination of runtime factors:
- Transparent hugepages (THP) were enabled on the running kernel.
- Applications or libraries used madvise(MADV_FREE) to indicate pages could be reclaimed.
- The workload was subject to cgroup memory limits and experienced heavy memory reclaim pressure.
When those conditions aligned, writes performed after MADV_FREE could be dropped silently rather than preserved or reported, producing unreported data loss in user-space.
# Real-world impact
This was not purely theoretical. The bug surfaced in production environments: users of the Polars data analytics library reported actual lost data tied to the kernel behavior. Reproductions were submitted via a small C program reported earlier in the month, validating how the interaction of THP, MADV_FREE, and cgroup limits could lead to lost writes under reclaim.
# What was fixed and how
The fix is a localized kernel patch that changes one line of code. It was merged into the x86/urgent tree and is slated for back-porting to supported stable kernel series, so administrators and distributions tracking stable kernels should expect the fix to appear in upcoming stable updates. The brevity of the patch suggests the root cause was a narrow logic error rather than a broad architectural flaw, but the runtime constraint mix made the bug significant in certain deployments.
# What administrators and developers should do
- Check whether your systems run with transparent hugepages enabled and whether workloads call MADV_FREE.
- If you use cgroup memory limits (common in containerized environments), prioritize updating kernels once the back-ported stable fix hits your distribution.
- If you observed unexplained or silent data loss in analytics or other memory-heavy applications, consider reproducing the conditions with a supplied test program (the report included a small C reproduction) and validate behavior on patched kernels.
# Timeline and provenance
- Bug introduced: July 2023, present since Linux 6.6.
- Public report and reproduction program: reported at the start of the month prior to the fix.
# Bottom line
A rare but real kernel bug that could silently drop user writes under a precise set of memory-management conditions has been fixed. Systems that use transparent hugepages, MADV_FREE, and cgroup memory limits should plan to apply the patched kernel once their distribution ships the back-ported fix, especially if they run memory-intensive analytics workloads like Polars.