Skip to content

Prevent accessing destroyed AccessibilityChannel in async callbacks#158

Open
JSUYA wants to merge 3 commits intoflutter-tizen:masterfrom
JSUYA:prevent_a11y_crash
Open

Prevent accessing destroyed AccessibilityChannel in async callbacks#158
JSUYA wants to merge 3 commits intoflutter-tizen:masterfrom
JSUYA:prevent_a11y_crash

Conversation

@JSUYA
Copy link
Member

@JSUYA JSUYA commented Mar 6, 2026

Prevents a crash if the callback is called after the AccessibilityChannel instance has been destroyed.

Add shutdown flag to prevent async callbacks from executing after the
AccessibilityChannel instance has been destroyed. This fixes potential
dangling pointer issues in OnAccessibilityBusAddressGet and
OnSessionBusConnection callbacks.
@JSUYA JSUYA self-assigned this Mar 6, 2026
@JSUYA JSUYA added the bug Something isn't working label Mar 6, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to prevent asynchronous callbacks from accessing a destroyed AccessibilityChannel instance by introducing a shutdown_ flag. However, the current implementation is flawed as checking the shutdown_ flag on a destroyed object introduces a Use-After-Free (UAF) vulnerability. This approach may still lead to undefined behavior by dereferencing a dangling pointer. A safer and more robust alternative using GCancellable to manage the async operation lifecycle is recommended. Additionally, the PR includes positive improvements such as better validation of DBus response types and socket addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants