Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0285c036 authored by Jim Shargo's avatar Jim Shargo
Browse files

Surface: hold onto dequeued buffers on disconnect.

This change prevents crashes caused by a client accessing an invalidated
buffer after an ANativeWindow surface is disconnected.

According to the ANativeWindow contract, surfaces can retain references
to dequeued buffers for an indeterminate amount of time.  This behavior
can lead to race conditions where a surface is disconnected by one part
of the system while another client is actively using it. When this
happens, the dequeued buffers are invalidated, causing the client to
crash on subsequent buffer operations.

To resolve this, this change introduces a "leaked" buffer set. When a
surface is disconnected, its dequeued buffers are moved to this set
instead of being immediately invalidated. These buffers are then safely
cleaned up during the next cancel or queue operation, including batched
transactions.

Bug: 432531444
Flag: EXEMPT bugfix
Test: new test

Change-Id: I5b601e5235923b50cb35691e8417e2e45fc4d673
parent fcc417d7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment