Shrink ashmem directly through shmem_fallocate
authorTobias Lindskog <tobias.lindskog@sonymobile.com>
Mon, 9 Feb 2015 07:10:39 +0000 (08:10 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 27 Oct 2015 08:27:39 +0000 (16:27 +0800)
commit04e3d2769610e380ae60ca772f891f48f8aa114f
tree482b1bffb8751a7cf950f8dbdfa565f26fcd3423
parent9b48fbb68580872b5be9d25a3d47189da6089bdc
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>
(cherry picked from commit 2ecc7f173a30ee7df10240d6944108252a5f5b7d)
drivers/staging/android/ashmem.c