-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathConcurrency.json
More file actions
219 lines (219 loc) · 8.08 KB
/
Concurrency.json
File metadata and controls
219 lines (219 loc) · 8.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
{
"CERT-C++": {
"CON50-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Allowing a mutex to go out of scope while it is locked removes protections around shared resources.",
"kind": "problem",
"name": "Do not destroy a mutex while it is locked",
"precision": "high",
"severity": "error",
"short_name": "DoNotAllowAMutexToGoOutOfScopeWhileLocked",
"shared_implementation_short_name": "DoNotAllowAMutexToGoOutOfScopeWhileLocked",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/medium",
"external/cert/likelihood/probable",
"external/cert/remediation-cost/high",
"external/cert/priority/p4",
"external/cert/level/l3"
]
},
{
"description": "Calling delete on a locked mutex removes protections around shared resources.",
"kind": "problem",
"name": "Do not destroy a mutex while it is locked",
"precision": "high",
"severity": "error",
"short_name": "DoNotDestroyAMutexWhileItIsLocked",
"shared_implementation_short_name": "DoNotDestroyAMutexWhileItIsLocked",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/medium",
"external/cert/likelihood/probable",
"external/cert/remediation-cost/high",
"external/cert/priority/p4",
"external/cert/level/l3"
]
}
],
"title": "Do not destroy a mutex while it is locked"
},
"CON51-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "A program that fails to release a lock on exceptional conditions will leave a lock in the locked state which will block other critical sections from executing properly.",
"kind": "problem",
"name": "Ensure actively held locks are released on exceptional conditions",
"precision": "very-high",
"severity": "error",
"short_name": "EnsureActivelyHeldLocksAreReleasedOnExceptionalConditions",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/low",
"external/cert/likelihood/probable",
"external/cert/remediation-cost/low",
"external/cert/priority/p6",
"external/cert/level/l2"
]
}
],
"title": "Ensure actively held locks are released on exceptional conditions"
},
"CON52-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Accesses to bit fields without proper concurrency protection can result in data races.",
"kind": "problem",
"name": "Prevent data races when accessing bit-fields from multiple threads",
"precision": "very-high",
"severity": "error",
"short_name": "PreventBitFieldAccessFromMultipleThreads",
"shared_implementation_short_name": "GuardAccessToBitFields",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/medium",
"external/cert/likelihood/probable",
"external/cert/remediation-cost/medium",
"external/cert/priority/p8",
"external/cert/level/l2"
]
}
],
"title": "Prevent data races when accessing bit-fields from multiple threads"
},
"CON53-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Circular waits leading to thread deadlocks may be avoided by locking in a predefined order.",
"kind": "problem",
"name": "Avoid deadlock by locking in a predefined order",
"precision": "medium",
"severity": "error",
"short_name": "DeadlockByLockingInPredefinedOrder",
"shared_implementation_short_name": "PreventDeadlockByLockingInPredefinedOrder",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/low",
"external/cert/likelihood/probable",
"external/cert/remediation-cost/medium",
"external/cert/priority/p4",
"external/cert/level/l3"
]
}
],
"title": "Avoid deadlock by locking in a predefined order"
},
"CON54-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Not wrapping functions that can wake up spuriously in a conditioned loop can result race conditions.",
"kind": "problem",
"name": "Wrap functions that can spuriously wake up in a loop",
"precision": "very-high",
"severity": "error",
"short_name": "WrapFunctionsThatCanSpuriouslyWakeUpInLoop",
"shared_implementation_short_name": "WrapSpuriousFunctionInLoop",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/low",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/medium",
"external/cert/priority/p2",
"external/cert/level/l3"
]
}
],
"title": "Wrap functions that can spuriously wake up in a loop"
},
"CON55-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Usage of `notify_one` within a thread can lead to potential deadlocks and liveness problems.",
"kind": "problem",
"name": "Preserve thread safety and liveness when using condition variables",
"precision": "high",
"severity": "error",
"short_name": "PreserveSafetyWhenUsingConditionVariables",
"shared_implementation_short_name": "PreserveSafetyWhenUsingConditionVariables",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/low",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/medium",
"external/cert/priority/p2",
"external/cert/level/l3"
]
}
],
"title": "Preserve thread safety and liveness when using condition variables"
},
"CON56-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Speculatively locking a non-recursive mutex that is already owned by the calling thread can result in undefined behavior.",
"kind": "problem",
"name": "Do not speculatively lock a non-recursive mutex that is already owned by the calling thread",
"precision": "high",
"severity": "error",
"short_name": "DoNotSpeculativelyLockALockedNonRecursiveMutex",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/low",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/high",
"external/cert/priority/p1",
"external/cert/level/l3"
]
},
{
"description": "Speculatively locking a non-recursive mutex that is already owned by the calling thread can result in undefined behavior.",
"kind": "problem",
"name": "(Audit) Do not speculatively lock a non-recursive mutex that is already owned by the calling thread",
"precision": "high",
"severity": "error",
"short_name": "LockedALockedNonRecursiveMutexAudit",
"tags": [
"correctness",
"concurrency",
"external/cert/severity/low",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/high",
"external/cert/priority/p1",
"external/cert/level/l3"
]
}
],
"title": "Do not speculatively lock a non-recursive mutex that is already owned by the calling thread"
}
}
}