linux/drivers/staging/android
Shawn Lin 6fa92e2bcf staging: ion: fix corruption of ion_import_dma_buf
we found this issue but still exit in lastest kernel. Simply
keep ion_handle_create under mutex_lock to avoid this race.

WARNING: CPU: 2 PID: 2648 at drivers/staging/android/ion/ion.c:512 ion_handle_add+0xb4/0xc0()
ion_handle_add: buffer already found.
Modules linked in: iwlmvm iwlwifi mac80211 cfg80211 compat
CPU: 2 PID: 2648 Comm: TimedEventQueue Tainted: G        W    3.14.0 #7
 00000000 00000000 9a3efd2c 80faf273 9a3efd6c 9a3efd5c 80935dc9 811d7fd3
 9a3efd88 00000a58 812208a0 00000200 80e128d4 80e128d4 8d4ae00c a8cd8600
 a8cd8094 9a3efd74 80935e0e 00000009 9a3efd6c 811d7fd3 9a3efd88 9a3efd9c
Call Trace:
  [<80faf273>] dump_stack+0x48/0x69
  [<80935dc9>] warn_slowpath_common+0x79/0x90
  [<80e128d4>] ? ion_handle_add+0xb4/0xc0
  [<80e128d4>] ? ion_handle_add+0xb4/0xc0
  [<80935e0e>] warn_slowpath_fmt+0x2e/0x30
  [<80e128d4>] ion_handle_add+0xb4/0xc0
  [<80e144cc>] ion_import_dma_buf+0x8c/0x110
  [<80c517c4>] reg_init+0x364/0x7d0
  [<80993363>] ? futex_wait+0x123/0x210
  [<80992e0e>] ? get_futex_key+0x16e/0x1e0
  [<8099308f>] ? futex_wake+0x5f/0x120
  [<80c51e19>] vpu_service_ioctl+0x1e9/0x500
  [<80994aec>] ? do_futex+0xec/0x8e0
  [<80971080>] ? prepare_to_wait_event+0xc0/0xc0
  [<80c51c30>] ? reg_init+0x7d0/0x7d0
  [<80a22562>] do_vfs_ioctl+0x2d2/0x4c0
  [<80b198ad>] ? inode_has_perm.isra.41+0x2d/0x40
  [<80b199cf>] ? file_has_perm+0x7f/0x90
  [<80b1a5f7>] ? selinux_file_ioctl+0x47/0xf0
  [<80a227a8>] SyS_ioctl+0x58/0x80
  [<80fb45e8>] syscall_call+0x7/0x7
  [<80fb0000>] ? mmc_do_calc_max_discard+0xab/0xe4

Fixes: 83271f626 ("ion: hold reference to handle...")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Cc: stable <stable@vger.kernel.org> # 3.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-17 06:11:04 -07:00
..
ion staging: ion: fix corruption of ion_import_dma_buf 2015-09-17 06:11:04 -07:00
trace android: convert sync to fence api, v6 2014-07-08 13:28:26 -07:00
uapi Staging: fixed multiple spelling errors. 2015-05-08 09:23:58 +02:00
Kconfig staging: android: Allow compile test of GPIO consumers if !GPIOLIB 2015-08-03 17:45:02 -07:00
Makefile staging: Remove logger and alarm-dev from android Makefile 2015-01-28 11:32:39 -08:00
TODO staging/android: Update ION TODO per LPC discussion 2015-09-13 09:28:27 -07:00
ashmem.c Staging driver patches for 4.3-rc1 2015-08-31 09:24:06 -07:00
ashmem.h
lowmemorykiller.c Staging driver patches for 4.2-rc1 2015-06-26 15:46:08 -07:00
sw_sync.c staging: android: sw_sync: checkpatch fixes 2014-09-19 16:35:53 -07:00
sw_sync.h staging: android: sw_sync: checkpatch fixes 2014-09-19 16:35:53 -07:00
sync.c staging: android: sync: Fix memory corruption in sync_timeline_signal(). 2015-03-26 10:58:51 +01:00
sync.h staging: android: Remove unnecessary externs 2015-08-14 17:38:15 -07:00
sync_debug.c Staging: android: fix line length coding style issue in sync_debug.c 2015-01-17 16:17:11 -08:00
timed_gpio.c Staging: android: timed_gpio.c: fix coding style errors 2015-08-05 11:55:44 -07:00
timed_gpio.h
timed_output.c Staging: android: timed_output.c: use kstrtoint() instead of sscanf() 2014-07-30 17:17:02 -07:00
timed_output.h