[CPU] Security fixes (#9009)
This commit is contained in:
parent
8ce22396b5
commit
02b1e9cf90
@ -526,10 +526,13 @@ void MKLDNNPlugin::MKLDNNInferRequest::changeDefaultPtr() {
|
||||
break;
|
||||
}
|
||||
|
||||
if (child->getType() == Concatenation && dynamic_cast<MKLDNNConcatNode*>(child.get())->isOptimized()) {
|
||||
if (child->getType() == Concatenation) {
|
||||
auto concat = dynamic_cast<MKLDNNConcatNode*>(child.get());
|
||||
if (concat && concat->isOptimized()) {
|
||||
canBeInPlace = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Cannot be in-place before split because split is using different ptrs without offsets
|
||||
if (child->getType() == Split) {
|
||||
|
@ -39,8 +39,8 @@ private:
|
||||
const int* offsetsData_ = nullptr;
|
||||
const int* defaultIndices_ = nullptr;
|
||||
|
||||
size_t _indicesLen;
|
||||
size_t _offsetsLen;
|
||||
size_t _indicesLen = 0;
|
||||
size_t _offsetsLen = 0;
|
||||
};
|
||||
|
||||
} // namespace MKLDNNPlugin
|
||||
|
@ -163,26 +163,11 @@ void MKLDNNGenericNode::execLayer() {
|
||||
|
||||
// TODO: use ngraph-based extension mechnism if needed to recompute shape
|
||||
isDynBatch = false;
|
||||
// TODO: uncomment after using ngraph-based extension mechnism
|
||||
// if (isDynBatch) {
|
||||
// for (size_t i = 0; i < inputs.size(); i++) {
|
||||
// auto td = inputs[i]->getTensorDesc();
|
||||
// td.setDims(inputDescs[i].getDims());
|
||||
// inputs[i] = make_blob_with_precision(td, getParentEdgeAt(i)->getMemory().GetData());
|
||||
// }
|
||||
// }
|
||||
|
||||
std::vector<InferenceEngine::Blob::Ptr> outputs;
|
||||
for (size_t i = 0; i < outputShapes.size(); i++) {
|
||||
if (isDynBatch) {
|
||||
auto out_edge = getChildEdgesAtPort(i)[0];
|
||||
auto td = MemoryDescUtils::convertToTensorDesc(out_edge->getMemory().getDesc());
|
||||
td.setDims(execOutputShapes[i]);
|
||||
outputs.push_back(make_blob_with_precision(td, out_edge->getMemory().GetData()));
|
||||
} else {
|
||||
outputs.push_back(MemoryDescUtils::interpretAsBlob(getChildEdgesAtPort(i)[0]->getMemory()));
|
||||
}
|
||||
}
|
||||
InferenceEngine::ResponseDesc resp;
|
||||
InferenceEngine::StatusCode rc = impls[0]->execute(inputs, outputs, &resp);
|
||||
if (rc != InferenceEngine::OK) {
|
||||
|
@ -48,10 +48,10 @@ private:
|
||||
static const size_t NMS_SELECTED_INDICES = 1;
|
||||
static const size_t NMS_VALID_OUTPUTS = 2;
|
||||
|
||||
size_t m_numBatches;
|
||||
size_t m_numBoxes;
|
||||
size_t m_numClasses;
|
||||
size_t m_maxBoxesPerBatch;
|
||||
size_t m_numBatches = 0;
|
||||
size_t m_numBoxes = 0;
|
||||
size_t m_numClasses = 0;
|
||||
size_t m_maxBoxesPerBatch = 0;
|
||||
|
||||
MatrixNmsSortResultType m_sortResultType;
|
||||
bool m_sortResultAcrossBatch;
|
||||
|
@ -138,7 +138,7 @@ private:
|
||||
using Vmm = typename conditional3<isa == cpu::x64::sse41, Xbyak::Xmm, isa == cpu::x64::avx2,
|
||||
Xbyak::Ymm, Xbyak::Zmm>::type;
|
||||
size_t vlen = cpu_isa_traits<isa>::vlen;
|
||||
bool planar_layout;
|
||||
bool planar_layout = false;
|
||||
|
||||
Xbyak::Address table_val(int index) { return ptr[reg_table + index * vlen]; }
|
||||
|
||||
@ -1136,7 +1136,7 @@ private:
|
||||
using Vmm = typename conditional3<isa == cpu::x64::sse41, Xbyak::Xmm, isa == cpu::x64::avx2,
|
||||
Xbyak::Ymm, Xbyak::Zmm>::type;
|
||||
size_t vlen = cpu_isa_traits<isa>::vlen;
|
||||
bool planar_layout;
|
||||
bool planar_layout = false;
|
||||
|
||||
Xbyak::Reg64 reg_dst = r8;
|
||||
Xbyak::Reg64 reg_work_amount = r9;
|
||||
|
@ -92,7 +92,8 @@ private:
|
||||
bool sort_value = false;
|
||||
bool mode_max = true;
|
||||
|
||||
int dim, before_num;
|
||||
int dim = 0;
|
||||
int before_num = 0;
|
||||
|
||||
std::string errorPrefix;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user