Skip to content
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

wasm: fix host function arg translation #18225

Merged
merged 2 commits into from
May 3, 2024

Conversation

rockwotj
Copy link
Contributor

@rockwotj rockwotj commented May 2, 2024

Expand the try/catch block in async host functions to catch arg translation exceptions (from out of bounds buffers being passed).
Otherwise this gets bubbled up over an ABI boundary which is not good (causes an abort).

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

Bug Fixes

  • Fix a bug where an invalid buffer passed into the WebAssembly host from the guest could cause Redpanda to abort.

rockwotj added 2 commits May 2, 2024 20:48
If a guest passes a bad buffer, we could throw in args translation and
that would cause a C++ exception to be risen into Rust over an FFI
boundary, which is bad (TM) and causes a process abort.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
@rockwotj rockwotj requested review from dotnwat and oleiman May 2, 2024 20:55
@rockwotj rockwotj self-assigned this May 2, 2024
@github-actions github-actions bot added area/redpanda area/wasm WASM Data Transforms labels May 2, 2024
@rockwotj rockwotj added this to the v24.1.2 milestone May 2, 2024
@rockwotj rockwotj requested a review from oleiman May 2, 2024 21:32
Copy link
Member

@oleiman oleiman left a comment

Choose a reason for hiding this comment

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

lgtm

@rockwotj rockwotj merged commit c845820 into redpanda-data:dev May 3, 2024
19 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@rockwotj
Copy link
Contributor Author

rockwotj commented May 3, 2024

Followup ticket to add tests to cover this: https://redpandadata.atlassian.net/browse/CORE-1408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda area/wasm WASM Data Transforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants