VYPR
Moderate severityNVD Advisory· Published Sep 16, 2022· Updated Apr 23, 2025

`CHECK` fail in `Conv2DBackpropInput` in TensorFlow

CVE-2022-35999

Description

TensorFlow is an open source platform for machine learning. When Conv2DBackpropInput receives empty out_backprop inputs (e.g. [3, 1, 0, 1]), the current CPU/GPU kernels CHECK fail (one with dnnl, the other with cudnn). This can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 27a65a43cf763897fecfa5cdb5cc653fc5dd0346. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflowPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-cpuPyPI
< 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-gpuPyPI
< 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
>= 2.9.0, < 2.9.12.9.1

Affected products

1

Patches

1
27a65a43cf76

Fix GPU/CPU Conv2DBackpropInputOp check error.

https://github.com/tensorflow/tensorflowAntonio SanchezJul 20, 2022via ghsa
2 files changed · +36 0
  • tensorflow/core/kernels/conv_grad_input_ops.h+19 0 modified
    @@ -37,6 +37,7 @@ limitations under the License.
     #include "tensorflow/core/kernels/conv_2d.h"
     #include "tensorflow/core/kernels/conv_grad_ops.h"
     #include "tensorflow/core/kernels/conv_grad_shape_utils.h"
    +#include "tensorflow/core/kernels/fill_functor.h"
     #ifdef TENSORFLOW_USE_LIBXSMM_CONVOLUTIONS
     #include "tensorflow/core/kernels/xsmm_conv2d.h"
     #endif
    @@ -436,6 +437,15 @@ class Conv2DBackpropInputOp : public OpKernel {
           return;
         }
     
    +    // If shapes are valid but `out_backprop` is empty, in_backprop should be
    +    // set to all zeros.  Otherwise, cudnn/dnnl fail with an empty input.
    +    if (out_backprop.NumElements() == 0) {
    +      functor::SetZeroFunctor<Device, T> set_zero;
    +      set_zero(context->eigen_device<Device>(),
    +               in_backprop->template flat<T>());
    +      return;
    +    }
    +
         // For now we take the stride from the second and third dimensions only (we
         // do not support striding on the batch or depth dimension).
         const int stride_rows = GetTensorDim(strides_, data_format_, 'H');
    @@ -554,6 +564,15 @@ class Conv2DCustomBackpropInputOp : public OpKernel {
           return;
         }
     
    +    // If shapes are valid but `out_backprop` is empty, in_backprop should be
    +    // set to all zeros.  Otherwise, cudnn/dnnl fail with an empty input.
    +    if (out_backprop.NumElements() == 0) {
    +      functor::SetZeroFunctor<Device, T> set_zero;
    +      set_zero(context->eigen_device<Device>(),
    +               in_backprop->template flat<T>());
    +      return;
    +    }
    +
     // TODO(ezhulenev): Remove custom kernel and move XSMM support to
     // LaunchConv2DBackpropInputOp functor.
     #if defined TENSORFLOW_USE_LIBXSMM_CONVOLUTIONS && \
    
  • tensorflow/python/kernel_tests/nn_ops/conv_ops_test.py+17 0 modified
    @@ -1103,6 +1103,23 @@ def testConv2DInputSizesContainsOnlySpatialDimensionsBackpropInput(self):
               use_gpu=use_gpu,
               err=1e-5)
     
    +  @test_util.run_in_graph_and_eager_modes
    +  @test_util.disable_xla("b/239598470")
    +  def testConv2DBackpropInputDegenerateBackpropInput(self):
    +    input_sizes = [3, 1, 1, 2]
    +    expected_output = np.zeros(input_sizes).flatten()
    +    for (data_format, use_gpu) in GetTestConfigs():
    +      self._RunAndVerifyBackpropInput(
    +          input_sizes=input_sizes,
    +          filter_sizes=[1, 3, 2, 3],
    +          output_sizes=[3, 1, 0, 3],
    +          strides=[1, 2],
    +          padding="VALID",
    +          expected=expected_output,
    +          data_format=data_format,
    +          use_gpu=use_gpu,
    +          err=1e-5)
    +
       # Testing for backprops
       def _RunAndVerifyBackpropFilter(self,
                                       input_sizes,
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.