Re: [PATCH v2] drm/i915/gvt: fix double free bug in split_2MB_gtt_entry

2022-10-06 Thread Zheng Hacker
Greg KH 于2022年10月7日周五 03:22写道: > > On Fri, Oct 07, 2022 at 12:58:45AM +0800, Zheng Wang wrote: > > If intel_gvt_dma_map_guest_page failed, it will call > > ppgtt_invalidate_spt, which will finally free the spt. > > But the caller does not notice that, it will free spt again in error path. > > > >

Re: [PATCH v2] drm/i915/gvt: fix double free bug in split_2MB_gtt_entry

2022-10-06 Thread Greg KH
On Fri, Oct 07, 2022 at 12:58:45AM +0800, Zheng Wang wrote: > If intel_gvt_dma_map_guest_page failed, it will call > ppgtt_invalidate_spt, which will finally free the spt. > But the caller does not notice that, it will free spt again in error path. > > Fix this by spliting invalidate and free in

[PATCH v2] drm/i915/gvt: fix double free bug in split_2MB_gtt_entry

2022-10-06 Thread Zheng Wang
If intel_gvt_dma_map_guest_page failed, it will call ppgtt_invalidate_spt, which will finally free the spt. But the caller does not notice that, it will free spt again in error path. Fix this by spliting invalidate and free in ppgtt_invalidate_spt. Only free spt when in good case. Reported-by: