[Devel] [PATCH RHEL9 COMMIT] oracle/mm: fix MADV_DONTEXEC to clear VM_EXEC_KEEP

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 23 23:35:47 MSK 2025


The commit is pushed to "branch-rh9-5.14.0-427.44.1.vz9.80.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.44.1.vz9.80.5
------>
commit 8b972ad412c9d2e91b88f7d02428c34734664963
Author: Anthony Yznaga <anthony.yznaga at oracle.com>
Date:   Fri Mar 18 09:43:10 2022 -0700

    oracle/mm: fix MADV_DONTEXEC to clear VM_EXEC_KEEP
    
    The new vm flags were being incorrectly or'd with the old ones.
    
    Orabug: 33987398
    
    Fixes: 4693c5d9d799 ("mm: introduce MADV_DOEXEC")
    Signed-off-by: Anthony Yznaga <anthony.yznaga at oracle.com>
    Reviewed-by: Jane Chu <jane.chu at oracle.com>
    Reviewed-by: HÃ¥kon Bugge <haakon.bugge at oracle.com>
    
    https://virtuozzo.atlassian.net/browse/VSTOR-96305
    
    (cherry picked from Oracle commit c8604eb57c0291dd04aef6e2794a66b3a82d5a8f)
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    Feature: oracle/mm: MADV_DOEXEC madvise() flag
---
 mm/madvise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index 2458d6ccdeb2..9ad5f3fa8fa1 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1103,7 +1103,7 @@ static int madvise_vma_behavior(struct vm_area_struct *vma,
 			goto out;
 		}
 		if (new_flags & VM_EXEC_KEEP)
-			new_flags |= (new_flags & ~VM_EXEC_KEEP) | VM_MAYEXEC;
+			new_flags = (new_flags & ~VM_EXEC_KEEP) | VM_MAYEXEC;
 		break;
 	case MADV_DONTDUMP:
 		new_flags |= VM_DONTDUMP;


More information about the Devel mailing list