Skip to content

fix(gfxstream): check linear buffer size before copy-path transfers#128

Merged
gurchetansingh merged 1 commit into
google:mainfrom
ikicha:robust-option-a
Jun 2, 2026
Merged

fix(gfxstream): check linear buffer size before copy-path transfers#128
gurchetansingh merged 1 commit into
google:mainfrom
ikicha:robust-option-a

Conversation

@ikicha

@ikicha ikicha commented May 30, 2026

Copy link
Copy Markdown
Contributor

Due to timing issues (e.g., during rapid surface recreation or rotation), the system may fail to import zero-copy resources and fall back to the copy-path. If this occurs, mLinear might be empty, leading to a host-side null pointer dereference crash.

This CL adds robust defensive checks to ReadFromPipeToLinear, ReadFromBufferToLinear, and ReadFromColorBufferToLinear to verify that mLinear is allocated and large enough before copying, safely returning -EINVAL otherwise.

Bug: 511078953
Test: Verified host stability under forced fallback and rapid orientation transitions.
Change-Id: I300d383ffb50ba7378518378cd5bde47d37541d9

Due to timing issues (e.g., during rapid surface recreation or rotation),
the system may fail to import zero-copy resources and fall back to the copy-path.
If this occurs, `mLinear` might be empty, leading to a host-side null pointer
dereference crash.

This CL adds robust defensive checks to `ReadFromPipeToLinear`,
`ReadFromBufferToLinear`, and `ReadFromColorBufferToLinear` to verify that
`mLinear` is allocated and large enough before copying, safely returning
`-EINVAL` otherwise.

Bug: 511078953
Test: Verified host stability under forced fallback and rapid orientation transitions.
Change-Id: I300d383ffb50ba7378518378cd5bde47d37541d9
@ikicha

ikicha commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

@gurchetansingh can you review this PR?

@gurchetansingh gurchetansingh added this pull request to the merge queue Jun 2, 2026
Merged via the queue into google:main with commit 2dd7e87 Jun 2, 2026
13 checks passed
@ikicha ikicha deleted the robust-option-a branch June 2, 2026 06:49
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.

3 participants