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)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 16 Jun 2018 21:22:17 +0000 (22:22 +0100)
commit8f628209e61333c4d79dc1d774d15c820c0b95ae
tree942ed7b716400b771b2e0088c56033c175dc9cee
parentc2c37cd0a0f45dd883fc03b38b04a7f0a269a1ca
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