~vcs-imports/bluez/master

Viewing all changes in revision 21046.

  • Committer: Brian Gix
  • Author(s): Przemysław Fierek
  • Date: 2021-03-01 17:09:03 UTC
  • Revision ID: git-v1:9bce8cafc57d9f92b19e94f4a9f8f3cd29c0c081
mesh: Fix infinite loop on IVIndex update

This patch fixes inifinite loop problem caused by recurring call
of the `net_key_beacon_refresh` function.

Problem occurs when at least two nodes are connected to the same
BlueZ instance and they are connected to the same network
(use same network key). Issue is triggered when IVIndex update
process stabilize and one of the nodes receives network beacon
with IVUpdate flag set to 0. Then it processes the "local" beacon
and compose new `snb` (with IVUpdate flag set to 0) attached to
`net_key` instance. After that it calls `net_local_beacon` and
another node processes the new beacon (this node has IVUpdate
flag still set to 1). Note that the `net->ivupdate` has set value 1.
The `update_iv_ivu_state` says that "IVU clear attempted too soon".
The node composes new `snb` with IVUpdate flag set to 1 and writes
it to the `net_key` instance in the `net_key_beacon_refresh`
function. After that it calls `net_local_beacon` which causes
repeat of all process. We are rotating in this loop until end-of-memory.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: