]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Staging: android: binder: Fix crashes when sharing a binder file between processes
authorArve Hjønnevåg <arve@android.com>
Wed, 1 Feb 2012 23:29:13 +0000 (15:29 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Feb 2012 19:28:50 +0000 (11:28 -0800)
commit992dc3393662b00527480b49b5076bdda0e86327
tree34a2acb116523665ba118bbc14c63e09e47ad8e8
parent038044951a5b58411446428629594e67320549e5
Staging: android: binder: Fix crashes when sharing a binder file between processes

commit bd1eff9741af27378b241b347041c724bb28e857 upstream.

Opening the binder driver and sharing the file returned with
other processes (e.g. by calling fork) can crash the kernel.
Prevent these crashes with the following changes:
- Add a mutex to protect against two processes mmapping the
  same binder_proc.
- After locking mmap_sem, check that the vma we want to access
  (still) points to the same mm_struct.
- Use proc->tsk instead of current to get the files struct since
  this is where we get the rlimit from.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/binder.c