[Mesa-dev] [RFC PATCH 45/65] st/mesa: do not release sampler views for resident textures

Marek Olšák maraeo at gmail.com
Wed May 24 11:11:28 UTC 2017


On Wed, May 24, 2017 at 1:06 PM, Marek Olšák <maraeo at gmail.com> wrote:
> On Wed, May 24, 2017 at 10:50 AM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>>
>>
>> On 05/23/2017 10:11 PM, Marek Olšák wrote:
>>>
>>> I don't think this change is necessary. Releasing sampler views
>>> doesn't release textures.
>>
>>
>> This issued has been reported by Feral directly. It happens in the following
>> scenario:
>>
>> 1) create a texture
>> 2) get a texture handle
>> 3) make it resident
>> 4) bind the texture to a unit
>> 5) draw
>>
>> The sampler views are then released and this ended up with a use-after-free
>> at decompression time for the resident texture handle.
>
> It seems that you keep a pointer to some object that is released by
> releasing sampler views. You need to increment the reference counter
> for that object, so that releasing sampler views won't release the
> object.

I'll reply on patch 52.

Marek


More information about the mesa-dev mailing list