[PATCH v2 09/11] apparmor: convert VMA flag tests to use vma_flags_t

From: Lorenzo Stoakes (ARM)

Date: Tue Nov 24 2026 - 12:12:16 EST


Replace use of the legacy vm_flags_t flags with vma_flags_t values in the
AppArmor mprotect LSM hook.

No functional change intended.

Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>
---
security/apparmor/lsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index eaebc3c60c5a..9ff9096b6199 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -591,7 +591,7 @@ static int apparmor_file_mprotect(struct vm_area_struct *vma,
unsigned long reqprot, unsigned long prot)
{
return common_mmap(OP_FMPROT, vma->vm_file, prot,
- !(vma->vm_flags & VM_SHARED) ? MAP_PRIVATE : 0);
+ !vma_test(vma, VMA_SHARED_BIT) ? MAP_PRIVATE : 0);
}

#ifdef CONFIG_IO_URING

--
2.56.1