Skip to content

Fix stack buffer overflow when XNNPACK tensor has too many dims #3233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

swolchok
Copy link
Contributor

Summary:
Noticed this overflow when I was looking through the XNNPACK backend.

I am not very familiar with executorch or XNNPACK, so please be critical in review! In particular, my test is crashing in xnn_delete_runtime and I don't know why; it was previously getting a UBSAN failure for the stack buffer overflow before I patched XNNExecutor.cpp

Differential Revision: D56450593

Copy link

pytorch-bot bot commented Apr 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3233

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 5c94e49 with merge base 3b0f271 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 23, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56450593

@swolchok swolchok requested review from mcr229 and cccclai and removed request for mcr229 April 23, 2024 01:51
Copy link
Contributor

@cccclai cccclai left a comment

Choose a reason for hiding this comment

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

Looks good to me! Maybe I'll let @mcr229 and @digantdesai for more detailed review...

@@ -38,9 +38,11 @@ def define_common_targets():
preprocessor_flags = [
# "-DENABLE_XNNPACK_PROFILING",
],
exported_deps = [
"//executorch/runtime/backend:interface",
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason we make it an exported_deps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's an include in a header (I think XNNExecutor.h), so dependent libraries that include that header need this dep. This is what exported_deps is for.

* LICENSE file in the root directory of this source tree.
*/

#include <executorch/backends/xnnpack/runtime/XNNExecutor.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

oh is it for the test....

swolchok added a commit to swolchok/executorch that referenced this pull request Apr 23, 2024
…rch#3233)

Summary:

Noticed this overflow when I was looking through the XNNPACK backend.

I am not very familiar with executorch or XNNPACK, so please be critical in review! In particular, my test is crashing in xnn_delete_runtime and I don't know why; it was previously getting a UBSAN failure for the stack buffer overflow before I patched XNNExecutor.cpp

Differential Revision: D56450593
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56450593

swolchok added a commit to swolchok/executorch that referenced this pull request Apr 23, 2024
…rch#3233)

Summary:

Noticed this overflow when I was looking through the XNNPACK backend.

I am not very familiar with executorch or XNNPACK, so please be critical in review! In particular, my test is crashing in xnn_delete_runtime and I don't know why; it was previously getting a UBSAN failure for the stack buffer overflow before I patched XNNExecutor.cpp

Differential Revision: D56450593
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56450593

swolchok added a commit to swolchok/executorch that referenced this pull request Apr 23, 2024
…rch#3233)

Summary:

Noticed this overflow when I was looking through the XNNPACK backend.

I am not very familiar with executorch or XNNPACK, so please be critical in review! In particular, my test is crashing in xnn_delete_runtime and I don't know why; it was previously getting a UBSAN failure for the stack buffer overflow before I patched XNNExecutor.cpp

Differential Revision: D56450593
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56450593

…rch#3233)

Summary:

Noticed this overflow when I was looking through the XNNPACK backend.

I am not very familiar with executorch or XNNPACK, so please be critical in review! In particular, my test is crashing in xnn_delete_runtime and I don't know why; it was previously getting a UBSAN failure for the stack buffer overflow before I patched XNNExecutor.cpp

Differential Revision: D56450593
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56450593

@swolchok swolchok requested a review from digantdesai April 26, 2024 21:54
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in dc726f9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants