linux-hardened/drivers/staging/android
Colin Cross 83271f6262 ion: hold reference to handle after ion_uhandle_get
commit 1262ab1846cf76f7549c66ef709120dbfbe6d49f (ion: replace
userspace handle cookies with idr) broke the locking in ion.
The ION_IOC_FREE and ION_IOC_MAP ioctls were relying on
ion_handle_validate to detect the case where a call raced
with another ION_IOC_FREE which may have freed the struct
ion_handle.

Rename ion_uhandle_get to ion_handle_get_by_id, and have it
take the client lock and return with an extra reference to
the handle.  Make each caller put its reference once it
is done with the handle.

Also modify users of ion_handle_validate to continue to hold
the client lock after calling ion_handle_validate until
they are done with the handle, and warn if ion_handle_validate
is called without the client lock held.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-14 08:57:18 -08:00
..
ion ion: hold reference to handle after ion_uhandle_get 2013-12-14 08:57:18 -08:00
trace
uapi ion: move userspace api into uapi/ion.h 2013-12-14 08:57:18 -08:00
alarm-dev.c staging: alarm-dev: Seperate functions with one blank line 2013-11-19 15:33:39 -08:00
android_alarm.h
ashmem.c staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value 2013-10-25 06:22:39 +01:00
ashmem.h
binder.c Staging: android: Mark local functions in binder.c as static 2013-09-17 07:47:39 -07:00
binder.h staging: android: binder: fix binder interface for 64bit compat layer 2013-07-23 14:37:22 -07:00
binder_trace.h
Kconfig gpu: ion: Add ION Memory Manager 2013-12-14 08:50:15 -08:00
logger.c Merge git://git.kvack.org/~bcrl/aio-next 2013-09-13 10:55:58 -07:00
logger.h
lowmemorykiller.c drivers: convert shrinkers to new count/scan API 2013-09-10 18:56:32 -04:00
Makefile gpu: ion: Add ION Memory Manager 2013-12-14 08:50:15 -08:00
ram_console.h
sw_sync.c android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd() 2013-08-15 17:26:44 -07:00
sw_sync.h
sync.c android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd() 2013-08-15 17:27:30 -07:00
sync.h staging: android: Fix typo in android/sync.h 2013-11-11 16:22:17 -08:00
timed_gpio.c
timed_gpio.h
timed_output.c staging: android: timed_output: fix sysfs file creation race 2013-08-24 10:27:29 -07:00
timed_output.h Staging: android: Remove extern from function prototypes in .h files 2013-09-17 07:47:39 -07:00
TODO