Posting this because I couldn't find the answer anywhere, and it finally fixed my iPhone 17 Pro Max on iOS 26.2.1 after months of freezing.
Symptoms: apps hanging on launch (Messages, DoorDash, Nest and others), System Data over 60 GB, and "available" storage wildly wrong. Crash logs showed apps killed while waiting on securityd, which sat at 98% CPU for ten minutes at a time. A factory reset only helped until iCloud synced again.
Cause: an old iPhone had written about 2 million "TLK share" records into iCloud Keychain, addressed to about 115,000 device identities that never existed. Every device that joined my account downloaded all of them.
How to check, from a Mac on the same Apple Account: give Terminal Full Disk Access, then run:
sqlite3 "file:$(ls ~/Library/Keychains/*/keychain-2.db)?immutable=1&mode=ro" "select count(*) from tlkshare"
A normal account has about 100. Mine had 2,082,503. If yours is in the hundreds, this isn't your problem.
What didn't work: "Reset End-to-End Encrypted Data" failed three times with "Unable to Connect to iCloud". The log showed Server Rejected Request (15/6000) .transactionalFailure, probably because the server can't delete millions of records in one transaction. Running ckksctl reset-cloudkit from a trusted Mac didn't stick either, because the records came right back.
What worked, in this order:
1. Make a full backup first. Step 4 deletes your end-to-end encrypted iCloud data, including keychain data and possibly Messages in iCloud.
2. On a Mac that is NOT trusted in iCloud Keychain and holds no local copy of the junk, run in Terminal: ckksctl reset-cloudkit
3. Confirm the server is empty: ckksctl resync should return changed=0 for every zone.
4. Then run Reset End-to-End Encrypted Data from that Mac. It is offered when you turn on Passwords and Keychain sync and the Mac cannot be approved by another device. With the zones empty it went through on the first try.
5. The iPhone dropped its local copy within minutes. Free space jumped by 30+ GB, the freezes stopped, and no erase was needed.
Happy to answer questions if anyone hits the same thing.