Commit 34b809f
committed
Fix soundness hole around access::Map
Backport to the 0.4 version, releasing as 0.4.8.
The assumption that the address of access's guarded reference stays the
same is not true.
Costs:
* The Map is now slower and adds an allocation.
* It can stop being Copy (but non-trivial guards weren't anyway) and
it can stop being Sync/Send if the closure is not.
* The taken closure needs to be Clone.
Fixes #45.
Technically, it is a breaking change, but the plan is not to raise major
version, because:
* Even rust std gives exception to break compatibility for soundness
hole fixes.
* It is not that likely people's code would break.
* Even if it breaks, they are much more likely to go to the fixed
version then if the version got bumped and that's what they should be
doing ASAP due to the potential UB.1 parent 77b5be7 commit 34b809f
4 files changed
+26
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
232 | 225 | | |
233 | 226 | | |
234 | | - | |
| 227 | + | |
235 | 228 | | |
236 | | - | |
237 | | - | |
| 229 | + | |
| 230 | + | |
238 | 231 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
252 | 235 | | |
253 | 236 | | |
254 | 237 | | |
| |||
277 | 260 | | |
278 | 261 | | |
279 | 262 | | |
280 | | - | |
| 263 | + | |
281 | 264 | | |
282 | 265 | | |
283 | 266 | | |
| |||
287 | 270 | | |
288 | 271 | | |
289 | 272 | | |
290 | | - | |
| 273 | + | |
291 | 274 | | |
292 | 275 | | |
293 | | - | |
| 276 | + | |
294 | 277 | | |
295 | | - | |
| 278 | + | |
296 | 279 | | |
297 | 280 | | |
298 | | - | |
299 | 281 | | |
300 | | - | |
301 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
302 | 285 | | |
303 | 286 | | |
304 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1217 | 1217 | | |
1218 | 1218 | | |
1219 | 1219 | | |
1220 | | - | |
| 1220 | + | |
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
| |||
0 commit comments