aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Kemisetti <rajeshk@codeaurora.org>2019-04-30 19:04:30 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-05-15 20:08:49 -0700
commit8a8ffd49120f7a1dc7a64f57b5d9915a1ebd6014 (patch)
tree3b950d7a930e9c930b7f843aebae3799ca209a84
parenta0dc2fc69e80e2caba32dff6c80b962e20a2d668 (diff)
msm: kgsl: Fix race condition while making page as dirtyLE.UM.2.3.1.c1-03300-8x09.0
set_page_dirty() is racy if the caller has no reference against page->mapping->host, and if the page is unlocked. This is because another CPU could truncate the page off the mapping and then free the mapping. Use set_page_dirty_lock() to avoid this race condition. Change-Id: I517fb9aee66560618c7676b311368f7a7498011f Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org> Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
-rw-r--r--drivers/gpu/msm/kgsl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index eb4c29d535d5..596d17381799 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -327,7 +327,7 @@ kgsl_mem_entry_destroy(struct kref *kref)
entry->memdesc.sgt->nents, i) {
page = sg_page(sg);
for (j = 0; j < (sg->length >> PAGE_SHIFT); j++)
- set_page_dirty(nth_page(page, j));
+ set_page_dirty_lock(nth_page(page, j));
}
}