Описание
Use after free / memory leak in CollectiveReduceV2
Impact
The async implementation of CollectiveReduceV2 suffers from a memory leak and a use after free:
This occurs due to the asynchronous computation and the fact that objects that have been std::move()d from are still accessed:
Here, done is already moved from by the time OP_REQUIRES_OK_ASYNC macro needs to invoke it in case of errors. In this case, we get an undefined behavior, which can manifest via crashes, std::bad_alloc throws or just memory leaks.
Patches
We have patched the issue in GitHub commit ca38dab9d3ee66c5de06f11af9a4b1200da5ef75.
The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, as this version is the only one that is also affected.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
Attribution
This vulnerability has been reported by members of the Aivul Team from Qihoo 360.
Ссылки
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-gpfh-jvf9-7wg5
- https://nvd.nist.gov/vuln/detail/CVE-2021-41220
- https://github.com/tensorflow/tensorflow/commit/ca38dab9d3ee66c5de06f11af9a4b1200da5ef75
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-629.yaml
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-827.yaml
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-412.yaml
Пакеты
tensorflow
= 2.6.0
2.6.1
tensorflow-cpu
= 2.6.0
2.6.1
tensorflow-gpu
= 2.6.0
2.6.1
Связанные уязвимости
TensorFlow is an open source platform for machine learning. In affected versions the async implementation of `CollectiveReduceV2` suffers from a memory leak and a use after free. This occurs due to the asynchronous computation and the fact that objects that have been `std::move()`d from are still accessed. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, as this version is the only one that is also affected.
TensorFlow is an open source platform for machine learning. In affecte ...