]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Fix orphan vgpu dmabuf_objs' lifetime
authorTina Zhang <tina.zhang@intel.com>
Tue, 25 Feb 2020 05:35:27 +0000 (13:35 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 25 Feb 2020 08:14:20 +0000 (16:14 +0800)
commit3b9da7e522b73267b945c712c41f7780e0380001
treea2b6c2ff0a12f7667dfc7c10536a7abfcc7d7d71
parent2c0125b3febbdddf18d73c74cadd7d268e34b61c
drm/i915/gvt: Fix orphan vgpu dmabuf_objs' lifetime

Deleting dmabuf item's list head after releasing its container can lead
to KASAN-reported issue:

  BUG: KASAN: use-after-free in __list_del_entry_valid+0x15/0xf0
  Read of size 8 at addr ffff88818a4598a8 by task kworker/u8:3/13119

So fix this issue by puting deleting dmabuf_objs ahead of releasing its
container.

Fixes: 67a2ea93a1bb7 ("drm/i915/gvt: Handle orphan dmabuf_objs")
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200225053527.8336-2-tina.zhang@intel.com
drivers/gpu/drm/i915/gvt/dmabuf.c