Skip to content

Prevent invalid access to tbm plane's attribute arrays#153

Merged
JSUYA merged 1 commit intoflutter-tizen:masterfrom
JSUYA:prevent_invalid_tbm_planes
Feb 11, 2026
Merged

Prevent invalid access to tbm plane's attribute arrays#153
JSUYA merged 1 commit intoflutter-tizen:masterfrom
JSUYA:prevent_invalid_tbm_planes

Conversation

@JSUYA
Copy link
Copy Markdown
Member

@JSUYA JSUYA commented Feb 11, 2026

If tbm_surface_internal_get_num_planes() returns a value outside the array bounds, invalid access may occur. To prevent this, specify a maximum value.

@JSUYA JSUYA self-assigned this Feb 11, 2026
Copy link
Copy Markdown

@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 a potential out-of-bounds memory access by introducing kTbmPlaneCountMax and capping the number of planes returned by tbm_surface_internal_get_num_planes. It correctly addresses a buffer overflow vulnerability that could lead to out-of-bounds access on arrays like plane_fd_ext, plane_offset_ext, plane_pitch_ext, and attribs. However, the current implementation of the plane count cap uses a signed/unsigned comparison that does not correctly handle potential negative error codes, which could still result in unintended behavior or crashes. Additionally, it would be beneficial to add a warning log when the number of planes is truncated to improve debuggability.

Comment thread flutter/shell/platform/tizen/external_texture_surface_egl.cc
If tbm_surface_internal_get_num_planes() returns a value outside the array bounds,
invalid access may occur. To prevent this, specify a maximum value.
@JSUYA JSUYA force-pushed the prevent_invalid_tbm_planes branch from 06aacec to a257792 Compare February 11, 2026 06:03
@JSUYA JSUYA merged commit 785ec52 into flutter-tizen:master Feb 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants