]> git.baikalelectronics.ru Git - kernel.git/commit
staging: android: ashmem: Disallow ashmem memory from being remapped
authorSuren Baghdasaryan <surenb@google.com>
Mon, 27 Jan 2020 23:56:16 +0000 (15:56 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2020 16:49:11 +0000 (08:49 -0800)
commit912ec013b43bdb495af4ca5c738c136783e08751
treec077940131b26debb4102649c5d97564cc0cb6eb
parent70f4eaccd8a6d394c1d1ac5e5ef6b59962f6435e
staging: android: ashmem: Disallow ashmem memory from being remapped

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 <jannh@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: stable <stable@vger.kernel.org> # 4.4,4.9,4.14,4.18,5.4
Signed-off-by: Todd Kjos <tkjos@google.com>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Link: https://lore.kernel.org/r/20200127235616.48920-1-tkjos@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ashmem.c