lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 11/14] mm/mshare: unmap vmas in mshare_unlink
Date
mshare() maps in vma for the calling task. These vmas should be
unmapped when the task calls mshare_unlink(). Add minimal code to
unmap vmas.

Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
---
mm/mshare.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/mm/mshare.c b/mm/mshare.c
index 40c495ffc0ca..ec23d1db79b2 100644
--- a/mm/mshare.c
+++ b/mm/mshare.c
@@ -490,6 +490,17 @@ SYSCALL_DEFINE1(mshare_unlink, const char *, name)
mmput(info->mm);
kfree(info);
} else {
+ /*
+ * TODO: If mshare'd range is still mapped in the process,
+ * it should be unmapped. Following is minimal code and
+ * might need fix up
+ */
+ unsigned long tmp;
+
+ tmp = info->mm->task_size - info->mm->mmap_base;
+ if (info->host_mm != current->mm)
+ vm_munmap(info->mm->mmap_base, tmp);
+
dput(dentry);
}

--
2.32.0
\
 
 \ /
  Last update: 2022-04-11 18:12    [W:0.240 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site