diff options
| author | Liu Zixian <[email protected]> | 2020-12-06 06:15:15 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2020-12-06 18:19:07 +0000 |
| commit | 309d08d9b3a3659ab3f239d27d4e38b670b08fc9 (patch) | |
| tree | 989f191d033e2a58ba5d546bc2782036c9daf173 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | hugetlb_cgroup: fix offline of hugetlb cgroup with reservations (diff) | |
| download | kernel-309d08d9b3a3659ab3f239d27d4e38b670b08fc9.tar.gz kernel-309d08d9b3a3659ab3f239d27d4e38b670b08fc9.zip | |
mm/mmap.c: fix mmap return value when vma is merged after call_mmap()
On success, mmap should return the begin address of newly mapped area,
but patch "mm: mmap: merge vma after call_mmap() if possible" set
vm_start of newly merged vma to return value addr. Users of mmap will
get wrong address if vma is merged after call_mmap(). We fix this by
moving the assignment to addr before merging vma.
We have a driver which changes vm_flags, and this bug is found by our
testcases.
Fixes: d70cec898324 ("mm: mmap: merge vma after call_mmap() if possible")
Signed-off-by: Liu Zixian <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Hongxiang Lou <[email protected]>
Cc: Hu Shiyuan <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions
