Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 46bd51ed authored by Mehmet Murat Sevim's avatar Mehmet Murat Sevim
Browse files

Fix potential data loss when writing to congested L2CAP CoC.

Observed this rare problem with busy sockets on Wear OS watches paried
with iOS:
1. Multiple poll events are received on the same poll call.
2. While processing commands ts[h].poll_count is incremented without updating pfds.
3. process_data_sock reads stale pfds entries and processes POLLIN on a
  fd that didn't actually receive this event.
4. Data is read from fd but dropped because the channel is congested.

The change copies the initial poll_count to avoid reading stale pfds entries.
Verified Wear iOS comms stack does not miss packets when using L2CAP
CoC after the change.

Bug: 223974328
Tag: #stability
Test: gd/cert/run

Change-Id: I676aa9f2f1074e5df89bbbf08f986c5fe8972358
parent 8d26041b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment