Skip to content

fix(core): validate op buffer backing stores - #36260

Open
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/op-buffer-backing-stores
Open

fix(core): validate op buffer backing stores#36260
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/op-buffer-backing-stores

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

This updates op2 buffer conversion so generated ops do not borrow slices from backing stores whose address or concurrency properties can change.

Read-only shared and resizable inputs are snapshotted before dispatch, preserving ordinary input behavior. Mutable, retained, and raw-pointer mappings reject those stores because copying would change their mutation or ownership contract. Detach-mode buffers keep their existing ownership-transfer path.

The fast and slow dispatch paths now apply the same rules. Regression coverage exercises shared and resizable typed arrays, ArrayBuffers, DataViews, retained buffers, raw pointers, copy-mode inputs, and Node isUtf8/isAscii compatibility.

Tests:

  • cargo test -p deno_ops
  • cargo test -p deno_core
  • cargo test -p unit_node_tests --test unit_node -- buffer_test
  • cargo clippy -p deno_core -p deno_ops --all-targets -- -D warnings
  • ./tools/format.js --check
  • ./tools/lint.js --js

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.

1 participant