-
Notifications
You must be signed in to change notification settings - Fork 61
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
rust: add Proxy-WASM for Rust (MVP). #46
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@jplevyak this is very much MVP, but it exercises all the interesting code paths, and unblocks work on other runtimes... I'll submit PR with calls to HTTP filters after I'm done with v8. |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
bc31dab
to
415522a
Compare
name = "proxy_wasm" | ||
version = "0.0.1" | ||
authors = ["Piotr Sikora <piotrsikora@google.com>"] | ||
edition = "2018" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Rust edition (think: C/C++ standard revisions), 2018 is the latest.
api/wasm/rust/src/lib.rs
Outdated
} | ||
|
||
/// Allow host to free memory. | ||
// TODO(PiotrSikora): make sure ptr is within acceptable range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the responsibility of the surrounding code. Wasm::freeMemory calls wasm_vm_->getMemoryOffset which returns false if the address is out of range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I was going back and forth on where it should be handled (I was mostly thinking about making sure that free()
isn't called for the addresses below __heap_base
, etc., but it's actually a bit tricky to do from within the WASM code).
I'll drop the TODO
. Thanks!
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* doc: version 1.12.7 Signed-off-by: Yuchen Dai <silentdai@gmail.com> * Preserve LWS from the middle of HTTP1 header values that requ… (envoyproxy#12319) * [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Also various fix to allow build on clang-10 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * http: header map security fixes for duplicate headers (#197) (#204) Previously header matching did not match on all headers for non-inline headers. This patch changes the default behavior to always logically match on all headers. Multiple individual headers will be logically concatenated with ',' similar to what is done with inline headers. This makes the behavior effectively consistent. This behavior can be temporary reverted by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to "false". Targeted fixes have been additionally performed on the following extensions which make them consider all duplicate headers by default as a comma concatenated list: 1) Any extension using CEL matching on headers. 2) The header to metadata filter. 3) The JWT filter. 4) The Lua filter. Like primary header matching used in routing, RBAC, etc. this behavior can be disabled by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to false. Finally, the setCopy() header map API previously only set the first header in the case of duplicate non-inline headers. setCopy() now behaves similiarly to the other set*() APIs and replaces all found headers with a single value. This may have had security implications in the extauth filter which uses this API. This behavior can be disabled by setting the runtime value "envoy.reloadable_features.http_set_copy_replace_all_headers" to false. Fixes https://github.com/envoyproxy/envoy-setec/issues/188 Signed-off-by: Matt Klein <mklein@lyft.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix wasm compile Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix typo Signed-off-by: Yuchen Dai <silentdai@gmail.com>
* doc: version 1.12.7 Signed-off-by: Yuchen Dai <silentdai@gmail.com> * Preserve LWS from the middle of HTTP1 header values that requ… (envoyproxy#12319) * [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Also various fix to allow build on clang-10 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * http: header map security fixes for duplicate headers (#197) (#204) Previously header matching did not match on all headers for non-inline headers. This patch changes the default behavior to always logically match on all headers. Multiple individual headers will be logically concatenated with ',' similar to what is done with inline headers. This makes the behavior effectively consistent. This behavior can be temporary reverted by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to "false". Targeted fixes have been additionally performed on the following extensions which make them consider all duplicate headers by default as a comma concatenated list: 1) Any extension using CEL matching on headers. 2) The header to metadata filter. 3) The JWT filter. 4) The Lua filter. Like primary header matching used in routing, RBAC, etc. this behavior can be disabled by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to false. Finally, the setCopy() header map API previously only set the first header in the case of duplicate non-inline headers. setCopy() now behaves similiarly to the other set*() APIs and replaces all found headers with a single value. This may have had security implications in the extauth filter which uses this API. This behavior can be disabled by setting the runtime value "envoy.reloadable_features.http_set_copy_replace_all_headers" to false. Fixes https://github.com/envoyproxy/envoy-setec/issues/188 Signed-off-by: Matt Klein <mklein@lyft.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix wasm compile Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix typo Signed-off-by: Yuchen Dai <silentdai@gmail.com> Co-authored-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Piotr Sikora piotrsikora@google.com