Public bug reported:

TL;DR: please backport upstream commit 6707915e030a ("mm: propagate
VM_SOFTDIRTY on merge").

[Impact]

When two adjacent VMAs are merged by mremap() or mprotect(), the
VM_SOFTDIRTY flag of one of them can be lost. As a result, pages in the
merged VMA are reported in /proc/PID/pagemap as not soft-dirty even
though they were never seen by the soft-dirty tracker.

CRIU relies on soft-dirty tracking for incremental (pre-dump) checkpoints.
On affected kernels, it intermittently fails with:

  Error (criu/page-xfer.c:299): page-xfer: Missing 7ff763ff9000 in parent 
pagemap
  Error (criu/page-xfer.c:344): page-xfer: Hole 0x7ff763ff9000 - 0x7ff763ffb000 
not found in parent
  Error (criu/mem.c:718): Can't dump page with parasite

We see such failures in runc CI on GitHub Actions ubuntu-24.04 runners,
which use linux-azure-6.17 (most recently 6.17.0-1022-azure), and believe
the missing fix below is the cause:

  
https://github.com/opencontainers/runc/actions/runs/37245396693/job/111562174665
  https://github.com/checkpoint-restore/criu/issues/2995

[Fix]

Upstream commit 6707915e030a ("mm: propagate VM_SOFTDIRTY on merge"),
merged in v6.19-rc1. It has been backported to 6.18.y as f563ce913a83
(v6.18.37), together with its prerequisites (VM_STICKY infrastructure).

[Test Case]

Upstream selftest c7ba92bcfea3 ("testing/selftests/mm: add soft-dirty
merge self-test"), test_merge() in tools/testing/selftests/mm/soft-dirty.c.

A standalone copy (no root needed):
https://github.com/kolyshkin/criu/blob/9781473278389ba68541bc670ae98cf9403204c2/repro/softdirty-merge.c

  gcc -o softdirty-merge softdirty-merge.c && ./softdirty-merge

On 6.17.0-1022-azure (GHA ubuntu-24.04):

  FAIL: soft-dirty after remap merge 1st pg
  FAIL: soft-dirty after remap merge 2nd pg
  FAIL: soft-dirty after mprotect merge 1st pg
  FAIL: soft-dirty after mprotect merge 2nd pg

On 7.0.0-1012-azure (GHA ubuntu-26.04), all four checks pass:

  https://github.com/kolyshkin/criu/actions/runs/37247103676

The fix is also absent from linux-hwe-6.17 (6.17.0-44.44) according to its
changelog, so it is likely affected as well.

** Affects: linux-azure-6.17 (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: linux-hwe-6.17 (Ubuntu)
     Importance: Undecided
         Status: New

** Also affects: linux-hwe-6.17 (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169508

Title:
  linux-azure-6.17: missing "mm: propagate VM_SOFTDIRTY on merge" breaks
  CRIU incremental dumps

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-azure-6.17/+bug/2169508/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to