wallet: detect cycles in BDB page traversal during migration #34946

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:2026-03-infinite_migrate changing 1 files +9 −0
  1. instagibbs commented at 10:43 pm on March 28, 2026: member

    The read-only BDB parser follows page chains without tracking visited pages. A crafted BDB file with circular references causes an infinite loop with unbounded memory growth, crashing the process.

    Add visited-page sets to both the BTree DFS traversal and overflow page chain traversal, throwing on the first revisited page.

    Script to craft a .dat file which demonstrated the issue (should run and suck up memory until OOM): https://gist.github.com/instagibbs/f92c17c34bfefa4aa391cb2b9c6306de

    Issue discovered/demo’d/fixed by Claude.

  2. wallet: detect cycles in BDB page traversal during migration
    The read-only BDB parser follows page chains without tracking
    visited pages. A crafted BDB file with circular references causes
    an infinite loop with unbounded memory growth, crashing the process.
    
    Add visited-page sets to both the BTree DFS traversal and overflow
    page chain traversal, throwing on the first revisited page.
    0bf2a12dd4
  3. DrahtBot added the label Wallet on Mar 28, 2026
  4. DrahtBot commented at 10:43 pm on March 28, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34959 (wallet: Enforce BDB btree levels and overflow item sizes by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-31 12:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me