tests/gem_storedw_loop: Fix use after free for bufmgr
PATCH 1/1 tests/gem_storedw_loop: Fix use after free for bufmgr
From: Robert Beckett <[email protected]>
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 <[email protected]> Date: Wed Aug 5 16:06:31 2015 -0700
tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2
--- tests/gem_storedw_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/gem_storedw_loop.c +1 -1
@@ -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); }
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 33 lines · On 09/22/2015 11:02 AM, [email protected] wrote:
From: Robert Beckett <[email protected]>
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
0679702150157706a6def66b893b29c16345f4dbAuthor: Jesse Barnes <[email protected]> Date: Wed Aug 5 16:06:31 2015 -0700tests/gem_storedw_loop: add new
store_dwordtest to unify per-ring ones v2Signed-off-by Robert Beckett <[email protected]>Cc Jesse Barnes <[email protected]>--- tests/gem_storedw_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_storedw_loop.c +0
-1@@ -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 {
tests/gem_storedw_loop.c igt_main · line 185
Quoted 6 lines
tests/gem_storedw_loop.c +1
-0@@ -181,5 +180,6 @@ igt_main } } +drm_intel_bufmgr_destroy (bufmgr);close (fd); }
Looks good, thanks. Unfortunately too late to squash...
Jesse
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 36 lines · Jesse Barnes
Quoted 35 lines · On 09/22/2015 11:02 AM, [email protected] wrote:
From: Robert Beckett <[email protected]>
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
0679702150157706a6def66b893b29c16345f4dbAuthor: Jesse Barnes <[email protected]> Date: Wed Aug 5 16:06:31 2015 -0700tests/gem_storedw_loop: add new
store_dwordtest to unify per-ring ones v2Signed-off-by Robert Beckett <[email protected]>Cc Jesse Barnes <[email protected]>--- tests/gem_storedw_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_storedw_loop.c +0
-1@@ -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 } }
Quoted 8 lines
tests/gem_storedw_loop.c igt_main · line 185
Quoted 4 lines
tests/gem_storedw_loop.c +1
-0+drm_intel_bufmgr_destroy (bufmgr);close (fd); }Looks good, thanks. Unfortunately too late to squash...
Reviewed-by Jesse Barnes <[email protected]>
No one from vpg has igt commit access so you need to push patches for them. I've done that now.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 44 lines · Daniel Vetter
Quoted 43 lines · Jesse Barnes
Quoted 33 lines · On 09/22/2015 11:02 AM, [email protected] wrote:
From: Robert Beckett <[email protected]>
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
0679702150157706a6def66b893b29c16345f4dbAuthor: Jesse Barnes <[email protected]> Date: Wed Aug 5 16:06:31 2015 -0700tests/gem_storedw_loop: add new
store_dwordtest to unify per-ring ones v2Signed-off-by Robert Beckett <[email protected]>Cc Jesse Barnes <[email protected]>--- tests/gem_storedw_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_storedw_loop.c +0
-1@@ -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 {tests/gem_storedw_loop.c igt_main · line 185
Quoted 6 lines
tests/gem_storedw_loop.c +1
-0@@ -181,5 +180,6 @@ igt_main } } +drm_intel_bufmgr_destroy (bufmgr);close (fd); }Looks good, thanks. Unfortunately too late to squash...
Quoted 4 lines
Quoted 1 line
Reviewed-by Jesse Barnes <[email protected]>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.
Quoted 9 lines
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 gem_storedw_loop: fix segfault when listing subtests
Commit fb66cd5 (tests/gem_storedw_loop: Fix use after free for bufmgr) introduced a segmentation fault when listing subtests because drm_intel_bufmgr_destroy is called with NULL. Move this and the call to the close function inside an igt_fixture block to prevent them being called when listing subtests.
--- tests/gem_storedw_loop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/gem_storedw_loop.c +4 -2
@@ -180,6 +180,8 @@ igt_main } } -drm_intel_bufmgr_destroy (bufmgr); -close (fd); + igt_fixture { +drm_intel_bufmgr_destroy (bufmgr); +close (fd); + } }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t] gem_storedw_loop: fix segfault when listing subtests
Quoted 20 lines · Thomas Wood
Commit fb66cd5 (tests/gem_storedw_loop: Fix use after free for bufmgr) introduced a segmentation fault when listing subtests because
drm_intel_bufmgr_destroyis called with NULL. Move this and the call to the close function inside anigt_fixtureblock to prevent them being called when listing subtests.Cc Robert Beckett <[email protected]>Cc Jesse Barnes <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Thomas Wood <[email protected]>--- tests/gem_storedw_loop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/gem_storedw_loop.c +0
-0
tests/gem_storedw_loop.c igt_main · line 187
Quoted 10 lines
tests/gem_storedw_loop.c +4
-2@@ -180,6 +180,8 @@ igt_main } } -drm_intel_bufmgr_destroy (bufmgr); -close (fd); + igt_fixture { +drm_intel_bufmgr_destroy (bufmgr); +close (fd); + } }
Um, yes. :) I won't pretend to know how the fixture stuff ought to work, so:
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx