mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
mm/madvise: use mmap_sem lock from passed mm_struct
Use the mmap_sem lock from passed 'mm' rather than the 'current' as it
is required because of the patchset[1]. The commit f4fa8d937e ("mm:
madvise: fix vma user-after-free") changed the 'mmap_sem' to use from
'current' instead of 'mm' context. Revert it.
Link: [1] https://patchwork.kernel.org/project/linux-mm/patch/20200302193630.68771-2-minchan@kernel.org/.
Change-Id: Ifc9deb2a5f0775c2bc97c85db3584f61fa3a43ae
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
parent
9bf32d7027
commit
6f65360b49
1 changed files with 1 additions and 1 deletions
|
|
@ -298,7 +298,7 @@ static long madvise_willneed(struct vm_area_struct *vma,
|
|||
get_file(file);
|
||||
offset = (loff_t)(start - vma->vm_start)
|
||||
+ ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
|
||||
up_read(¤t->mm->mmap_sem);
|
||||
up_read(&mm->mmap_sem);
|
||||
vfs_fadvise(file, offset, end - start, POSIX_FADV_WILLNEED);
|
||||
fput(file);
|
||||
down_read(&mm->mmap_sem);
|
||||
|
|
|
|||
Loading…
Reference in a new issue