staging: android: ashmem: Disallow ashmem memory from being remapped
commit 6d67b0290b4b84c477e6a2fc6e005e174d3c7786 upstream.
When ashmem file is mmapped, the resulting vma->vm_file points to the
backing shmem file with the generic fops that do not check ashmem
permissions like fops of ashmem do. If an mremap is done on the ashmem
region, then the permission checks will be skipped. Fix that by disallowing
mapping operation on the backing shmem file.
Reported-by: Jann Horn <firstname.lastname@example.org>
Signed-off-by: Suren Baghdasaryan <email@example.com>
Cc: stable <firstname.lastname@example.org> # 4.4,4.9,4.14,4.18,5.4
Signed-off-by: Todd Kjos <email@example.com>
Reviewed-by: Joel Fernandes (Google) <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>
1 file changed