Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r2.9 cherry-pick: 3796cc4fcd9 "Fix tf.raw_ops.DepthwiseConv2dNativeBackpropInput vulnerability with large input sizes." #55884

Merged
merged 1 commit into from May 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions tensorflow/core/kernels/depthwise_conv_grad_op.cc
Expand Up @@ -623,7 +623,7 @@ class DepthwiseConv2dNativeBackpropInputOp : public OpKernel {
OP_REQUIRES(context, in_sizes_data[i] >= 0,
errors::InvalidArgument("Dimension ", i,
" of input_sizes must be >= 0"));
input_shape.AddDim(in_sizes_data[i]);
OP_REQUIRES_OK(context, input_shape.AddDimWithStatus(in_sizes_data[i]));
}
const TensorShape& filter_shape = filter.shape();
EXTRACT_AND_VERIFY_DIMENSIONS("DepthwiseConv2DBackpropInput");
Expand Down Expand Up @@ -1120,7 +1120,8 @@ class DepthwiseConv2dNativeBackpropFilterOp : public OpKernel {
OP_REQUIRES(context, filter_sizes_data[i] >= 0,
errors::InvalidArgument("Dimension ", i,
" of filter_sizes must be >= 0"));
filter_shape.AddDim(filter_sizes_data[i]);
OP_REQUIRES_OK(context,
filter_shape.AddDimWithStatus(filter_sizes_data[i]));
}
const TensorShape& input_shape = input.shape();

Expand Down