OSDN Git Service

staging: android: ashmem: Fix a race condition in pin ioctls
authorBen Hutchings <ben@decadent.org.uk>
Sun, 4 Feb 2018 02:06:27 +0000 (02:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:05:44 +0000 (11:05 +0100)
commit2dfe49da487cf92b45083deb38e37062a5b8f83e
treeafc6e32819af6113a066ed0a9e08e0186a60a7d1
parentfedae0f64845933a0f28604a09be2e0323d66236
staging: android: ashmem: Fix a race condition in pin ioctls

commit ce8a3a9e76d0193e2e8d74a06d275b3c324ca652 upstream.

ashmem_pin_unpin() reads asma->file and asma->size before taking the
ashmem_mutex, so it can race with other operations that modify them.

Build-tested only.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ashmem.c