[Devel] [PATCH hci-8.1 3/8] oracle/mm: do not write protect COW mappings when preserving across exec
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Oct 14 20:20:11 MSK 2026
> From: Anthony Yznaga <anthony.yznaga at oracle.com>
>
> A mapping that is pinned for DMA and preserved across exec can incur
> a COW if write protected. The elevated reference count prevents reuse
> of the mapped folio.
>
> Orabug: 38029049
> Suggested-by: Steve Sistare <steven.sistare at oracle.com>
> Signed-off-by: Anthony Yznaga <anthony.yznaga at oracle.com>
> Reviewed-by: Harry Yoo <harry.yoo at oracle.com>
> (cherry picked from commit f2e56cc70e62fe07efb71a1e1c2360a78cba5aff)
>
> Taken from Oracle linux-uek branch uek8/u2. Applied cleanly.
>
> This is the fix for the ticket: a FOLL_LONGTERM-pinned anonymous page
> preserved with MADV_DOEXEC was write-protected and lost
> PageAnonExclusive in vma_dup(), so the first write in the new image
> COWed it and the pin kept the old page. The pinned pages now stay
> exclusive and writable in the new mm, and the old mm keeps its own. The
> fixes that follow write protect both again and zap the old mm's mappings
> right after the copy.
>
> Fixes: 9e6d16a6c0a1 ("oracle/mm: introduce VM_EXEC_KEEP")
> https://virtuozzo.atlassian.net/browse/VSTOR-150231
>
> Feature: oracle/mm: MADV_DOEXEC madvise() flag
> Assisted-by: LLM
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261014-b4-prep-khorenko-vstor-149847-2-doexec-pinned-memory-v1-0-36f1120f9b57@virtuozzo.com?part=3
More information about the Devel
mailing list