CVE-2021-37692
Description
TensorFlow is an end-to-end open source platform for machine learning. In affected versions under certain conditions, Go code can trigger a segfault in string deallocation. For string tensors, `C.TF_TString_Dealloc` is called during garbage collection within a finalizer function. However, tensor structure isn't checked until encoding to avoid a performance penalty. The current method for dealloc assumes that encoding succeeded, but segfaults when a string tensor is garbage collected whose encoding failed (e.g., due to mismatched dimensions). To fix this, the call to set the finalizer function is deferred until `NewTensor` returns and, if encoding failed for a string tensor, deallocs are determined based on bytes written. We have patched the issue in GitHub commit 8721ba96e5760c229217b594f6d2ba332beedf22. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, which is the other affected version.
How to fix
- google tensorflow2.6.0 or later
- tensorflow2.5.1, 2.3.4, 2.4.3 or later
- tensorflow-cpu2.5.1, 2.3.4, 2.4.3 or later
- tensorflow-gpu2.5.1, 2.3.4, 2.4.3 or later
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| google tensorflow | 2.5.0 ≤ v < 2.6.0 | 2.6.0 |
| tensorflowPyPI | 2.5.0rc0 ≤ v < 2.5.1, 2.3.0 ≤ v < 2.3.4, 2.4.0 ≤ v < 2.4.3 | 2.5.1, 2.3.4, 2.4.3 |
| tensorflow-cpuPyPI | 2.5.0rc0 ≤ v < 2.5.1, 2.3.0 ≤ v < 2.3.4, 2.4.0 ≤ v < 2.4.3 | 2.5.1, 2.3.4, 2.4.3 |
| tensorflow-gpuPyPI | 2.5.0rc0 ≤ v < 2.5.1, 2.3.0 ≤ v < 2.3.4, 2.4.0 ≤ v < 2.4.3 | 2.5.1, 2.3.4, 2.4.3 |
Check your version
Choose the product and enter the version you run to see whether it falls in the affected range.
Attack Surface Management
See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.