Skip to content

sqlite: prevent reentrant session.close() - #65349

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:sqlite-session-close-changeset
Open

sqlite: prevent reentrant session.close()#65349
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:sqlite-session-close-changeset

Conversation

@trivikr

@trivikr trivikr commented Aug 17, 2026

Copy link
Copy Markdown
Member

Fixes: #65347

Reject session.close() while generating a changeset or patchset. Closing the session at that point frees it while SQLite is still using it, causing a use-after-free.


Assisted-by: codex:gpt-5.6-sol

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Aug 17, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 17, 2026
Reject session.close() while generating a changeset or patchset.
Closing the session at that point frees it while SQLite is still
using it, causing a use-after-free.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
@trivikr
trivikr force-pushed the sqlite-session-close-changeset branch from c61fa72 to b7d480e Compare August 17, 2026 06:29
@trivikr trivikr changed the title sqlite: prevent reentrant Session.close() sqlite: prevent reentrant session.close() Aug 17, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (977c20e) to head (b7d480e).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65349      +/-   ##
==========================================
+ Coverage   90.11%   90.14%   +0.02%     
==========================================
  Files         752      752              
  Lines      251609   251611       +2     
  Branches    47284    47284              
==========================================
+ Hits       226740   226806      +66     
+ Misses      16217    16150      -67     
- Partials     8652     8655       +3     
Files with missing lines Coverage Δ
src/node_sqlite.cc 82.14% <100.00%> (+0.01%) ⬆️
src/node_sqlite.h 86.00% <ø> (ø)

... and 35 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.

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++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlite: use-after-free when Session.close() is called reentrantly

3 participants