Skip to content

Guard BaseViewProps downcasts in AnimationBackend (#60524) - #60524

Open
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D136090146
Open

Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D136090146

Conversation

@Abbondanzo

@Abbondanzo Abbondanzo commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

AnimationBackend::cloneProps and AnimationBackendCommitHook::shadowTreeWillCommit previously used std::static_pointer_cast<const BaseViewProps> when cloning props for animated nodes. If a non-BaseViewProps node (such as TextShadowNode) receives an animated update, the unconditional static downcast is undefined behavior and writing typed view props overflows the Props object.

Guard typed view-prop application in both paths with std::dynamic_pointer_cast<const BaseViewProps> and skip typed view props when the downcast is null.

Changelog:
[General][Fixed] - Guard BaseViewProps downcasts in AnimationBackend against non-view shadow nodes

Signed-off-by: Peter Abbondanzo abbo@meta.com

Reviewed By: javache

Differential Revision: D136090146

@meta-codesync

meta-codesync Bot commented Dec 3, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D136090146.

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot changed the title Guard BaseViewProps downcasts in AnimationBackend Guard BaseViewProps downcasts in AnimationBackend (#60524) Dec 5, 2026
Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Dec 5, 2026
Summary:

`AnimationBackend::cloneProps` and `AnimationBackendCommitHook::shadowTreeWillCommit` previously used `std::static_pointer_cast<const BaseViewProps>` when cloning props for animated nodes. If a non-`BaseViewProps` node (such as `TextShadowNode`) receives an animated update, the unconditional static downcast is undefined behavior and writing typed view props overflows the `Props` object.

Guard typed view-prop application in both paths with `std::dynamic_pointer_cast<const BaseViewProps>` and skip typed view props when the downcast is null.

Changelog:
[General][Fixed] - Guard `BaseViewProps` downcasts in `AnimationBackend` against non-view shadow nodes

Signed-off-by: Peter Abbondanzo <abbo@meta.com>

Reviewed By: javache

Differential Revision: D136090146
Summary:

`AnimationBackend::cloneProps` and `AnimationBackendCommitHook::shadowTreeWillCommit` previously used `std::static_pointer_cast<const BaseViewProps>` when cloning props for animated nodes. If a non-`BaseViewProps` node (such as `TextShadowNode`) receives an animated update, the unconditional static downcast is undefined behavior and writing typed view props overflows the `Props` object.

Guard typed view-prop application in both paths with `std::dynamic_pointer_cast<const BaseViewProps>` and skip typed view props when the downcast is null.

Changelog:
[General][Fixed] - Guard `BaseViewProps` downcasts in `AnimationBackend` against non-view shadow nodes

Signed-off-by: Peter Abbondanzo <abbo@meta.com>

Reviewed By: javache

Differential Revision: D136090146

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants