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:07:52 +0000 (11:07 +0100)
commit95f9c2edcbaea324be43d45540dda080fcd677f8
tree157f527dcdfe46721438b43f7c44afa13d42c048
parent441b5d10e4602b25ad960d1ca1c6bb77e788c220
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