
...
Code Block |
---|
int account_balance; mutex_t account_lock; void debit(int amount) { mutex_lock(&account_lock); account_balance \-= amount; mutex_unlock(&account_lock); } void credit(int amount) { mutex_lock(&account_lock); account_balance \+= amount; mutex_unlock(&account_lock); } |
Risk Assessment
Race conditions caused by multiple threads concurrently accessing and modifying the same data could lead to abnormal termination and denial-of-service attacks, or in cases like the above data integrity violation.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MSC06-A | 1 (low) | 1 (unlikely) | 1 (high) | P1 | L3 |
...