]> git.baikalelectronics.ru Git - kernel.git/commit
staging: android: ashmem: Shrink directly through shmem_fallocate
authorTobias Lindskog <tobias.lindskog@sonymobile.com>
Fri, 6 Jul 2018 21:44:16 +0000 (14:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2018 09:49:16 +0000 (11:49 +0200)
commit6a605039e82af665a1f346c041b3308eb5f586b7
tree96dc3a25c4f83218f8091f0501c8ee757bfce746
parent7cc640857a280099a759f6b1c237990eb4327126
staging: android: ashmem: Shrink directly through shmem_fallocate

When ashmem_shrink is called from direct reclaim on a user thread, a
call to do_fallocate will check for permissions against the security
policy of that user thread.  It can thus fail by chance if called on a
thread that isn't permitted to modify the relevant ashmem areas.

Because we know that we have a shmem file underneath, call the shmem
implementation of fallocate directly instead of going through the
user-space interface for fallocate.

Signed-off-by: Tobias Lindskog <tobias.lindskog@sonymobile.com>
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ashmem.c