All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 v2 0/9] selftests/mm: broader MADV_DOEXEC coverage
@ 2026-10-21 16:57 Konstantin Khorenko
  2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 1/9] selftests/mm: cover the MADV_DOEXEC interface and VMA attributes Konstantin Khorenko
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Konstantin Khorenko @ 2026-10-21 16:57 UTC (permalink / raw)
  To: Andrey Drobyshev, Pavel Tikhomirov, Vasileios Almpanis; +Cc: devel

Selftests for MADV_DOEXEC beyond the cases the fixes need: the sysctl
and the refused mappings, partial and attribute-carrying ranges (mlock,
DONTFORK, WIPEONFORK, userfaultfd, memory policy), the opt-in note
(missing, malformed, not in the last PT_NOTE), a preserved range under
the new stack, large, swapped and partly marked THP ranges, an exec from
a vfork() child, VM_MAYEXEC read from smaps and given back to the
copies, and a /proc/pid/mem write and a vhost kthread that keep the old
mm across the exec. Failing cases say why. Applies on top of "mm: allow
MADV_DOEXEC on VFIO BAR mappings".

All cases pass on release and debug kernels with the whole stack.

https://virtuozzo.atlassian.net/browse/VSTOR-150234

---
Changes in v2:
- "selftests/mm: say why a doexec case fails": when a page that should
  be gone after exec is still mapped, print the smaps entry at that
  address and its first byte. "MADV_DONTEXEC: range not preserved"
  failed once with "range still mapped" on a debug kernel with the whole
  stack and "vfio, exec: two mainline fixes that Oracle carries", and
  did not fail again, also not as the first run after a reboot. The
  cause is not found; the next failure will show whether the kernel kept
  the page or the new image mapped something else there.
- Same patch: the VFIO BAR case, skipped unless DOEXEC_VFIO_DEVICE is
  set, now says how to enable it, and the run_vmtests.sh help names
  the variable.
- Same patch: wrap a line over 100 columns that checkpatch flagged.
- New patch "selftests/mm: run repeated live updates through
  MADV_DOEXEC": a chain of preserving execs, each generation checking
  and rewriting THP-backed RAM with a long-term pin and, when
  DOEXEC_VFIO_DEVICE is set, a VFIO BAR, with an idle thread alive at
  every exec.
- New patch "selftests/mm: do not lose doexec failures": write()
  results are checked, so a clone race failure is not turned into a
  pass and a shared-mm child cannot stay blocked; the allocation sweep
  flushes its message before _exit(). Raised by the Sashiko review of
  v1 of "mm: keep DMA-pinned MADV_DOEXEC memory working across exec".
- Link to v1: http://lore.virtuozzo.com/20261014-b4-prep-khorenko-vstor-149847-5-doexec-selftests-v1-0-b23b454691db@virtuozzo.com

---
Konstantin Khorenko (9):
      selftests/mm: cover the MADV_DOEXEC interface and VMA attributes
      selftests/mm: cover the MADV_DOEXEC opt-in note and the new stack
      selftests/mm: cover large, swapped and partly marked THP ranges
      selftests/mm: check that MADV_DOEXEC refuses an exec from a vfork() child
      selftests/mm: check VM_MAYEXEC of MADV_DOEXEC ranges in smaps
      selftests/mm: check who can still reach the old mm of a preserving exec
      selftests/mm: say why a doexec case fails
      selftests/mm: run repeated live updates through MADV_DOEXEC
      selftests/mm: do not lose doexec failures

 tools/testing/selftests/mm/doexec.c       | 1799 +++++++++++++++++++++++++----
 tools/testing/selftests/mm/run_vmtests.sh |    4 +-
 2 files changed, 1574 insertions(+), 229 deletions(-)
---
base-commit: aece33e30a95e185591244ec5cadc8bd37e9f1fb
change-id: 20261014-b4-prep-khorenko-vstor-149847-5-doexec-selftests-496ac17b9688

Best regards,
--  
Konstantin Khorenko <khorenko@virtuozzo.com>

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-04 19:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21 16:57 [Devel] [PATCH hci-8.1 v2 0/9] selftests/mm: broader MADV_DOEXEC coverage Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 1/9] selftests/mm: cover the MADV_DOEXEC interface and VMA attributes Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 2/9] selftests/mm: cover the MADV_DOEXEC opt-in note and the new stack Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 3/9] selftests/mm: cover large, swapped and partly marked THP ranges Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 4/9] selftests/mm: check that MADV_DOEXEC refuses an exec from a vfork() child Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 5/9] selftests/mm: check VM_MAYEXEC of MADV_DOEXEC ranges in smaps Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 6/9] selftests/mm: check who can still reach the old mm of a preserving exec Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 7/9] selftests/mm: say why a doexec case fails Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 8/9] selftests/mm: run repeated live updates through MADV_DOEXEC Konstantin Khorenko
2026-10-21 16:57 ` [Devel] [PATCH hci-8.1 v2 9/9] selftests/mm: do not lose doexec failures Konstantin Khorenko
2026-11-04 19:22 ` [Devel] [PATCH hci-8.1 v2 0/9] selftests/mm: broader MADV_DOEXEC coverage Konstantin Khorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.