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

`CHECK` fail in `MaxPool` in TensorFlow

CVE-2022-35989

Description

TensorFlow is an open source platform for machine learning. When MaxPool receives a window size input array ksize with dimensions greater than its input tensor input, the GPU kernel gives a CHECK fail that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 32d7bd3defd134f21a4e344c8dfd40099aaf6b18. 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
32d7bd3defd1

Fix MaxPool crash on GPU for invalid filter size.

https://github.com/tensorflow/tensorflowAntonio SanchezJul 22, 2022via ghsa
2 files changed · +19 0
  • tensorflow/core/kernels/maxpooling_op.cc+7 0 modified
    @@ -1268,6 +1268,13 @@ class MaxPoolingNoMaskOp<GPUDevice, T> : public OpKernel {
             ShapeFromFormat(data_format_, params.tensor_in_batch, params.out_height,
                             params.out_width, params.depth);
     
    +    // Degenerate pooling output should return an empty tensor.
    +    if (out_shape.num_elements() == 0) {
    +      Tensor* output = nullptr;
    +      OP_REQUIRES_OK(context, context->allocate_output(0, out_shape, &output));
    +      return;
    +    }
    +
         // Assuming qint8 <--> NCHW_VECT_C (int8x4) here.
         constexpr bool is_int8x4 = std::is_same<T, qint8>::value;
         OP_REQUIRES(context, (is_int8x4 == (data_format_ == FORMAT_NCHW_VECT_C)),
    
  • tensorflow/python/kernel_tests/nn_ops/pooling_ops_test.py+12 0 modified
    @@ -772,6 +772,18 @@ def testMaxPoolEmptyInput(self, **kwargs):
             expected=[],
             **kwargs)
     
    +  @parameterized.parameters(
    +      GetTestConfigsDicts(nn_ops.max_pool, gen_nn_ops.max_pool_v2))
    +  @test_util.run_deprecated_v1
    +  def testMaxPoolInvalidFilterSize(self, **kwargs):
    +    with self.cached_session(use_gpu=test.is_gpu_available()):
    +      t = constant_op.constant(1.0, shape=[1, 1, 1, 1])
    +      with self.assertRaisesRegex(
    +          (errors_impl.InvalidArgumentError, ValueError),
    +          "Negative dimension size"):
    +        t = self.evaluate(
    +            nn_ops.max_pool(t, ksize=[1, 1, 2, 1], strides=1, padding="VALID"))
    +
       # Tests for DepthwiseMaxPooling on CPU only.
       @parameterized.parameters(
           GetTestConfigsDicts(
    

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.