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

Security Fuzz Test Fixes #21608

Merged
merged 16 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions onnxruntime/core/framework/tensorprotoutils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ common::Status ConstantNodeProtoToTensorProto(const ONNX_NAMESPACE::NodeProto& n
common::Status ConstantNodeProtoToTensorProto(const ONNX_NAMESPACE::NodeProto& node,
const std::filesystem::path& model_path,
ONNX_NAMESPACE::TensorProto& tensor) {
ORT_ENFORCE(node.output_size() == 1, "NodeProto for Constant should have 1 output. Got:", node.output_size());
return ConstantNodeProtoToTensorProto(node, model_path, tensor, node.output(0));
}

Expand Down
4 changes: 4 additions & 0 deletions onnxruntime/core/optimizer/unsqueeze_elimination.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Status UnsqueezeElimination::Apply(Graph& graph, Node& node, RewriteRuleEffect&
// Generate new dims.
InlinedVector<int64_t> new_dims(output_rank, 0);
for (int64_t axis : axes) {
if (static_cast<size_t>(axis) >= new_dims.size()) {
LOGS(logger, WARNING) << "UnsqueezeElimination cannot remove node due to invalid axes" << node.Name();
return Status::OK();
}
new_dims[static_cast<size_t>(axis)] = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/cpu/quantization/qlinearconv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ Status QLinearConv<ActType>::PrePack(const Tensor& tensor, int input_idx, Alloca
const int64_t M = shape[0];
const int64_t C = shape[1];

// Verify that the total number of output channels is a multiple of the group count.
if (M % conv_attrs_.group != 0) {
// Verify that conv_attrs_.group is not 0 and the total number of output channels is a multiple of the group count.
if (conv_attrs_.group == 0 || M % conv_attrs_.group != 0) {
return Status::OK();
}

Expand Down
Loading