-
-
Notifications
You must be signed in to change notification settings - Fork 127
fix: self-DM/sibling decryption deadlock (retry shape + session recovery + peer pkmsg identity) #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix: self-DM/sibling decryption deadlock (retry shape + session recovery + peer pkmsg identity) #635
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
cda07ef
fix(send): align DM retry stanza with WA Web (479 SmaxInvalid)
jlucaso1 e02fd2a
fix: CI feedback — drop duplicated #[allow] and trim retry shape comm…
jlucaso1 56ddef2
test(e2e): ignore retry_dm_multidevice — mock server doesn't route the
jlucaso1 62dd6f7
fix(retry): forward receipt's recipient verbatim (WA Web parity)
jlucaso1 c31f06d
fix(retry): force session recreate on no-keys retry receipts (whatsme…
jlucaso1 d56323a
review: harden retry tests + recreate-on-error semantics
jlucaso1 35f94cd
test(retry): pin recipient verbatim forwarding from receipt attr
jlucaso1 d6b4612
fix(pdo): address peer messages to LID when LID-migrated (WA Web parity)
jlucaso1 47db358
Revert "fix(pdo): address peer messages to LID when LID-migrated (WA …
jlucaso1 712f5e4
fix(lid-migration): PN session wins on conflict (whatsmeow parity)
jlucaso1 bf691f5
fix(libsignal): transactional decrypt — failed MAC must not advance c…
jlucaso1 53c98e0
fix(message): migrate PN session on inbound BadMac/InvalidMessage
jlucaso1 234b922
fix(pdo): address peer messages to LID when LID-migrated (whatsmeow p…
jlucaso1 8a54365
fix(send): include <meta>+<device-identity> on peer pkmsg (whatsmeow …
jlucaso1 ac0d1c1
test(send): regression tests for peer pkmsg stanza layout
jlucaso1 27be97b
review: address PR #635 comments + fix CI
jlucaso1 5a70089
fix(send): refuse to ship peer pkmsg without <device-identity>
jlucaso1 0a59219
perf(libsignal): snapshot only mutable decrypt fields + scrub PII
jlucaso1 676e07c
review: address Codex+CodeRabbit findings
jlucaso1 7ad35e9
review: serialize migration with session_locks + fix throttle expiry
jlucaso1 c643592
test(retry): exercise throttle-expiry branch via injectable clock
jlucaso1 39f299f
fix(lid-migration): skip re-acquiring LID lock that decrypt caller holds
jlucaso1 668c385
refactor(lid-migration): lock dance in the function, not its API
jlucaso1 c5f9683
review: address all Codex devil's-advocate findings
jlucaso1 24c6057
fix(send): restore checked-out session in pkmsg pre-flight (CodeRabbi…
jlucaso1 c3edc17
review: conservative pre-flight + dedup duplicate phone batches (Code…
jlucaso1 42a4ec2
fix(send): close pkmsg pre-flight gap in prepare_group_retry_stanza
jlucaso1 83708e7
nit: fix step numbering + doc-comment on inner test helper
jlucaso1 b12c144
feat(example): auto-pair benchmark example with mock server
jlucaso1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
migrate_signal_sessions_on_lid_discoverynow takes per-address session locks, but this function is invoked fromprocess_session_enc_batchwhile that path already holdssession_lock_for(sender_encryption_jid)for decrypt. When the sender is LID (the only case that triggers migration), the loop over0..=99includes the same address/device and this code attempts to lock it again (first_lockorsecond_lock), which awaits forever on a non-reentrant mutex. In practice, a BadMac/InvalidPreKey/SessionNotFound recovery attempt can deadlock the decrypt task and stall further messages for that sender.Useful? React with 👍 / 👎.