doc,test: mem protection must be observed in ffi#62818
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62818 +/- ##
==========================================
- Coverage 91.55% 89.62% -1.93%
==========================================
Files 356 706 +350
Lines 149601 219136 +69535
Branches 23395 41982 +18587
==========================================
+ Hits 136967 196410 +59443
- Misses 12371 14618 +2247
- Partials 263 8108 +7845 🚀 New features to boost your workflow:
|
|
Codewise it LGTM! |
| '-p', | ||
| ` | ||
| const ffi = require('node:ffi'); | ||
| const { functions } = ffi.dlopen('${libraryPath}', ${symbols}) |
There was a problem hiding this comment.
| const { functions } = ffi.dlopen('${libraryPath}', ${symbols}) | |
| const { functions } = ffi.dlopen(${JSON.stringify(libraryPath)}, ${symbols}) |
| #include <stdint.h> | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
| #include <sys/mman.h> |
There was a problem hiding this comment.
The #ifdef _WIN32 below this line makes me assume that this file is also compiled on Windows, which means that this include here (and the actual function that was added) should probably be in #ifndef _WIN32 guards?
When using ffi.toBuffer, memory protection on any memory pages exposed must be observed by the caller, otherwise crashes will occur. Now documented, and tested.
43f68d7 to
b448d7f
Compare
f3d4109 to
48ebb7a
Compare
|
@bengl https://ci.nodejs.org/job/node-test-binary-windows-js-suites/40143/ - This is the only relevant failure. |
Commit Queue failed- Loading data for nodejs/node/pull/62818 ✔ Done loading data for nodejs/node/pull/62818 ----------------------------------- PR info ------------------------------------ Title doc,test: mem protection must be observed in ffi (#62818) Author Bryan English <[email protected]> (@bengl) Branch bengl:bengl/ffi-mem-prot-doc-test -> nodejs:main Labels needs-ci, commit-queue-squash, ffi Commits 3 - doc,test: mem protection must be observed in ffi - fixup! doc,test: mem protection must be observed in ffi - fixup! fixup! doc,test: mem protection must be observed in ffi Committers 1 - Bryan English <[email protected]> PR-URL: https://github.com/nodejs/node/pull/62818 Reviewed-By: Paolo Insogna <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/62818 Reviewed-By: Paolo Insogna <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 19 Apr 2026 04:39:14 GMT ✔ Approvals: 1 ✔ - Paolo Insogna (@ShogunPanda) (TSC): https://github.com/nodejs/node/pull/62818#pullrequestreview-4146967369 ✘ This PR needs to wait 114 more hours to land (or 0 minutes if there is one more approval) ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-04-21T04:58:19Z: https://ci.nodejs.org/job/node-test-pull-request/72808/ - Querying data for job/node-test-pull-request/72808/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/24718303601 |
|
Landed in 3a53447 |
When using ffi.toBuffer, memory protection on any memory pages exposed must be observed by the caller, otherwise crashes will occur. Now documented, and tested. PR-URL: #62818 Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When using ffi.toBuffer, memory protection on any memory pages exposed must be observed by the caller, otherwise crashes will occur. Now documented, and tested. PR-URL: nodejs#62818 Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When using ffi.toBuffer, memory protection on any memory pages exposed must be observed by the caller, otherwise crashes will occur.
Now documented, and tested.