Phoronix iconPhoronixSep 14, 2026 ~2 min source read

Linux fixes three-year silent user-space data loss bug tied to THP, MADV_FREE, and cgroups

A one-line kernel patch merged into the x86/urgent tree after Linux 7.3-rc3 corrects a bug introduced in July 2023 that could silently drop user writes when specific memory features and limits are in play.

Linux Patched For Silent User-Space Data Loss Bug That's Existed Since 2023

Share this story

Send the public story page.

Useful takeaways from this story.

A data-loss bug affecting kernels since Linux 6.6 (introduced July 2023) is fixed by a one-line change merged after Linux 7.3-rc3.

Trigger conditions: transparent hugepages (THP) enabled, use of MADV_FREE, and processes running under cgroup memory limits with heavy reclaim pressure.

This was a real-production issue: users of the Polars data analytics library reported actual lost data.

# 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.

More context around this story.

Loading more related stories...

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app