[24.x] Bugfix: Wallet: Lock cs_wallet for SignMessage #26178

pull luke-jr wants to merge 1 commits into bitcoin:24.x from luke-jr:fix_descrwallet_signmsg_deadlck changing 1 files +1 −0
  1. luke-jr commented at 5:18 PM on September 24, 2022: member

    (Clean merge of #26130 to 24.x branch)

  2. Bugfix: Wallet: Lock cs_wallet for SignMessage
    cs_desc_main is typically locked within scope of a cs_wallet lock, but:
    
    CWallet::IsLocked locks cs_wallet
    ...called from DescriptorScriptPubKeyMan::GetKeys
    ...called from DescriptorScriptPubKeyMan::GetSigningProvider which locks cs_desc_main first, but has no access to cs_wallet
    ...called from DescriptorScriptPubKeyMan::SignMessage
    ...called from CWallet::SignMessage which can access and lock cs_wallet
    
    Resolve the out of order locks by grabbing cs_wallet in CWallet::SignMessage first
    a60d9eb9e6
  3. fanquake added this to the milestone 24.0 on Sep 24, 2022
  4. fanquake added the label Backport on Sep 24, 2022
  5. MarcoFalke merged this on Sep 25, 2022
  6. MarcoFalke closed this on Sep 25, 2022

  7. bitcoin locked this on Sep 25, 2023

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-04-14 15:13 UTC

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