Skip to content

ffi: validate fast pointer BigInt argument ranges - #65032

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-bigint-range-bypass
Open

ffi: validate fast pointer BigInt argument ranges#65032
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-bigint-range-bypass

Conversation

@trivikr

@trivikr trivikr commented Aug 5, 2026

Copy link
Copy Markdown
Member

Fixes: #65031

Optimized V8 fast API calls truncate out-of-range pointer BigInts. Validate them against uintptrMax before invoking the raw function so optimized calls match the generic and shared-buffer paths.


Assisted-by: codex:gpt-5.6-sol

Optimized V8 fast API calls truncate out-of-range pointer BigInts.
Validate them against uintptrMax before invoking the raw function
so optimized calls match the generic and shared-buffer paths.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run. labels Aug 5, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 5, 2026
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (c8fa0b1) to head (7f83e09).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65032      +/-   ##
==========================================
- Coverage   92.04%   90.30%   -1.74%     
==========================================
  Files         399      759     +360     
  Lines      175810   247645   +71835     
  Branches    27119    46693   +19574     
==========================================
+ Hits       161816   223630   +61814     
- Misses      13682    15467    +1785     
- Partials      312     8548    +8236     
Files with missing lines Coverage Δ
lib/internal/ffi/fast-api.js 94.13% <100.00%> (+68.58%) ⬆️
src/node_ffi.cc 70.71% <ø> (ø)

... and 488 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 6, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ffi: optimized fast pointer BigInts bypass range validation

3 participants