Re: [PATCH i-g-t] tests/gem_storedw_loop: Fix use after free for bufmgr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 September 2015 at 17:01, Daniel Vetter <daniel@xxxxxxxx> wrote:
> On Tue, Sep 22, 2015 at 12:08:05PM -0700, Jesse Barnes wrote:
>> On 09/22/2015 11:02 AM, robert.beckett@xxxxxxxxx wrote:
>> > From: Robert Beckett <robert.beckett@xxxxxxxxx>
>> >
>> > Move bufmgr destruction to end of tests. This avoids use after free on
>> > successive tests.
>> >
>> > This could be squashed with the following patch to aid bisectability:
>> >
>> > commit 0679702150157706a6def66b893b29c16345f4db
>> > Author: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
>> > Date:   Wed Aug 5 16:06:31 2015 -0700
>> >
>> >     tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2
>> >
>> > Signed-off-by: Robert Beckett <robert.beckett@xxxxxxxxx>
>> > Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
>> > ---
>> >  tests/gem_storedw_loop.c |    2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/tests/gem_storedw_loop.c b/tests/gem_storedw_loop.c
>> > index 10b12d4..e7ebcc2 100644
>> > --- a/tests/gem_storedw_loop.c
>> > +++ b/tests/gem_storedw_loop.c
>> > @@ -128,7 +128,6 @@ store_test(int ring, int count)
>> >
>> >     drm_intel_bo_unreference(target_buffer);
>> >     intel_batchbuffer_free(batch);
>> > -   drm_intel_bufmgr_destroy(bufmgr);
>> >  }
>> >
>> >  struct ring {
>> > @@ -181,5 +180,6 @@ igt_main
>> >             }
>> >     }
>> >
>> > +   drm_intel_bufmgr_destroy(bufmgr);
>> >     close(fd);
>> >  }
>> >
>>
>> Looks good, thanks.  Unfortunately too late to squash...
>>
>> Reviewed-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
>
> No one from vpg has igt commit access so you need to push patches for
> them. I've done that now.

Unfortunately this patch causes --list-subtest to fail, since the call
to drm_intel_bufmgr_destroy is called with NULL which causes a
segmentation fault. The calls to drm_intel_bufmgr_destroy and close
should be in an igt_fixture block.


> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux