Commit 40c7ae0
committed
mh_emsmdb: reorder instructions in MhEmsmdbPlugin::term
1. thread1_checks_field: Thread1 uses the value read from field
pending_status in the condition
`this->status[context_id].pending_status == PENDING_STATUS_NONE`. It
sees that the condition is false.
CID 1558752: (#1 of 1): Check of thread-shared field evades lock
acquisition (LOCK_EVASION)
5. thread2_checks_field_early: Thread2 checks pending_status, reading
it after Thread1 assigns to pending_status but before some of the
correlated field assignments can occur. It sees the condition
this->status[context_id].pending_status == PENDING_STATUS_NONE as
being true. It continues on before the critical section has
completed, and can read data changed by that critical section while
it is in an inconsistent state.
[There is no threading here; the term function knowingly has
exclusive access over the element identified by context_id.
Reduce the locked section in an attempt to nudge cov-scan
to see it for what it is.]1 parent 8e1f428 commit 40c7ae0
1 file changed
+9
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
793 | | - | |
794 | | - | |
795 | 794 | | |
796 | 795 | | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
802 | 801 | | |
803 | | - | |
804 | 802 | | |
805 | | - | |
806 | | - | |
807 | | - | |
| 803 | + | |
| 804 | + | |
808 | 805 | | |
809 | 806 | | |
810 | 807 | | |
| |||
0 commit comments