[igt-dev] [PATCH 7/7] tests/panfrost: Test FD-close while jobs are still in-flight

Alyssa Rosenzweig alyssa at collabora.com
Mon Jun 21 13:37:51 UTC 2021


r-b

On Mon, Jun 21, 2021 at 02:57:24PM +0200, Boris Brezillon wrote:
> We had use-after-free faults in the past because the MMU context
> while released while jobs were still in flight, and the job cleanup
> path assumed the context was still present. Add a test to make sure this
> won't happen again.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> ---
>  tests/panfrost_submit.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/panfrost_submit.c b/tests/panfrost_submit.c
> index aa2c277bbdb6..ef2437d60ab7 100644
> --- a/tests/panfrost_submit.c
> +++ b/tests/panfrost_submit.c
> @@ -159,6 +159,17 @@ igt_main
>                  close(tmpfd);
>          }
>  
> +        igt_subtest("pan-submit-and-close") {
> +                /* We need our own FD because we close it right after the job submission */
> +                int tmpfd = drm_open_driver(DRIVER_PANFROST);
> +                struct panfrost_submit *submit;
> +
> +                submit = igt_panfrost_job_loop(tmpfd);
> +                do_ioctl(tmpfd, DRM_IOCTL_PANFROST_SUBMIT, submit->args);
> +                igt_panfrost_free_job(tmpfd, submit);
> +                close(tmpfd);
> +        }
> +
>          igt_fixture {
>                  close(fd);
>          }
> -- 
> 2.31.1
> 


More information about the igt-dev mailing list