mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-23 18:47:40 -04:00
The makeslab function in rdataslab.c contains an optimization for cases where the source is already an rdataslab. In these cases, it copies the entire slab using memmove. However, this creates a race condition: while the target slab is protected by a node lock, the source slab is not protected. This becomes problematic because the TTL heap needs to modify the heap index stored in the slab header, potentially while the memmove operation is reading from it. A closer look at makeslab shows that copying the header part of the slab is unnecessary, the header can be default-initialized instead. This MR modifies makeslab to copy only the raw part of the slab, while default-initializing the header, eliminating the race condition. For consistency, it also applies the same change to vecheader/makevec. |
||
|---|---|---|
| .. | ||
| dns | ||
| isc | ||
| isccc | ||
| isccfg | ||
| ns | ||
| .gitignore | ||
| meson.build | ||