Shrink ashmem directly through shmem_fallocate
authorTobias Lindskog <tobias.lindskog@sonymobile.com>
Mon, 9 Feb 2015 07:10:39 +0000 (08:10 +0100)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 11 Jan 2016 04:18:50 +0000 (09:48 +0530)
commit9cba14efb869b58f55e248012d4f4ea73f02dd8d
tree6e43fc8c1c2c3f9a1d25f2a718c93fe1dabf5863
parentbedf47303d316c12865d44714bfdf74cbcd10515
Shrink ashmem 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.

FIX=DMS06243560
Area: Kernel/Linux Kernel

Bug: 21951515
Change-Id: Ie98fff18a2bdeb535cd24d4fbdd13677e12681a7
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
drivers/staging/android/ashmem.c