summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2015-09-01 18:52:45 +0300
committerDmitry Kovalenko <d.kovalenko@samsung.com>2015-09-07 01:33:35 -0700
commit92d6e368e96cc8b0ec166c75f6d04e5b7506b1e7 (patch)
tree1eceb2f1909dbf7348da538d94f603c99118c734
parent0031104ca9afac91f827f8330ef278ffb0de411d (diff)
downloadswap-modules-92d6e368e96cc8b0ec166c75f6d04e5b7506b1e7.tar.gz
swap-modules-92d6e368e96cc8b0ec166c75f6d04e5b7506b1e7.tar.bz2
swap-modules-92d6e368e96cc8b0ec166c75f6d04e5b7506b1e7.zip
[FIX] Take mmap_sem on urp disarming in mm_release
Change-Id: I565d7f3d611f4173fd751014bd7519ccf7fc6218 Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
-rw-r--r--us_manager/helper.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/us_manager/helper.c b/us_manager/helper.c
index e5eeb2cb..3c338e86 100644
--- a/us_manager/helper.c
+++ b/us_manager/helper.c
@@ -388,7 +388,15 @@ static void unregister_cp(void)
static unsigned long mr_cb(void *data)
{
struct task_struct *task = *(struct task_struct **)data;
+ struct mm_struct *mm = task->mm;
+ if (mm == NULL) {
+ pr_err("mm is NULL\n");
+ return 0;
+ }
+
+ /* TODO: this lock for synchronizing to disarm urp */
+ down_write(&mm->mmap_sem);
if (task->tgid != task->pid) {
struct sspt_proc *proc;
struct hlist_head head = HLIST_HEAD_INIT;
@@ -414,6 +422,7 @@ static unsigned long mr_cb(void *data)
} else {
call_mm_release(task);
}
+ up_write(&mm->mmap_sem);
return 0;
}