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 <email@example.com>
Signed-off-by: Suren Baghdasaryan <firstname.lastname@example.org>
Cc: stable <email@example.com> # 4.4,4.9,4.14,4.18,5.4
Signed-off-by: Todd Kjos <firstname.lastname@example.org>
Reviewed-by: Joel Fernandes (Google) <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
1 file changed