<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 3, 2017 at 11:15 AM, Chris Wilson <span dir="ltr"><<a href="mailto:chris@chris-wilson.co.uk" target="_blank">chris@chris-wilson.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Quoting Jason Ekstrand (2017-08-03 19:06:02)<br>
<span class="">> I'm not concerned about what happens to racy clients.  They get what they get. <br>
> What concerns me is what happens if somehow the fence is replaced and deleted<br>
> before i915_gem_request_await_dma_<wbr>fence takes it's reference.  Can this cause<br>
> the kernel to segfault?<br>
<br>
</span>Gotcha, yup nothing prevents that.<br>
<br>
        fence = dma_fence_get_rcu_safe(&<wbr>syncobj->fence);<br>
        if (!fence)<br>
                return -EINVAL;<br>
<br>
        err = await_fence();<br>
        dma_fence_put(fence);<br>
        if (err < 0)<br>
                return;<br>
<br>
Happy?<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Assuming dma_fence_get_rcu_safe does what I think it does, then yes.<br></div></div><br></div></div>