iris: avoid use after free in shader destruction
authorDave Airlie <airlied@redhat.com>
Thu, 4 Apr 2019 01:18:26 +0000 (11:18 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 4 Apr 2019 23:57:44 +0000 (09:57 +1000)
commit0ea386128b8fe4a4c0dc32101c4d4dd565723341
treeae0745ae9556005c513335b2e8694a982fc52ff4
parent42f63e6334c925f0eb11805f8b9279e4f449d976
iris: avoid use after free in shader destruction

While playing with compute shaders, I was getting a random crash,
noticed that bind_state was using the old shader info for comparision,
but gallium allows the shader to be deleted while bound, so this could
lead to a use after free.

This can't happen using the cso cache. As it tracks all of this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_program.c