apache / apache/mynewt-nimble

mesh: Multi-thread safety issue

Open
#199 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
893
Forks
512
Avg merge
13d 31m
Merged PRs (30d)
7

Description

I found a multi-thread safety issue in mesh stack code and it still exist in the newest version.
When "seg_ack" was called by callout module, there was anthoer thread which receive mesh datas was calling "seg_rx_reset()" and set the "rx->sub" to NULL, then "seg_ack" called "send_ack" and acess the rx->sub->net_idx, so it crashed.
The adv-sending task and ble-data-receiving task and each "callout" are not in the same thread, why don't you add the Multi-thread protection mechanism in mesh stack? or something I used the wrong way?
Waiting for your replies! thank you so much!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the mesh-stack paths named in the report: seg_ack, send_ack, seg_rx_reset(), and the callout, advertising, and BLE data-receiving tasks. Reproduce the concurrent reset and acknowledgement scenario, then verify that seg_ack cannot access rx->sub->net_idx after seg_rx_reset() clears it, without introducing a crash or race.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.