From 0a52b2587e662367e586a00b7ef9522743a1f200 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 2 Sep 2022 11:02:00 +0800 Subject: [PATCH] fix(opencl/test): fix test weight preprocess filter UAF issue GitOrigin-RevId: de5e71147bf9a31344e1d85f01f8f4e4d0329f58 --- dnn/test/common/opr_proxy.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dnn/test/common/opr_proxy.h b/dnn/test/common/opr_proxy.h index 09202a123..f70807fa8 100644 --- a/dnn/test/common/opr_proxy.h +++ b/dnn/test/common/opr_proxy.h @@ -579,6 +579,10 @@ struct OprWeightPreprocessProxyImpl : public OprProxyProfilingBase { } AlgoProxy::exec( opr, tensors, &preprocessed_filter, Base::W.workspace()); + //! as preprocess_tensors will call destructor at end of this function, + //! sync to wait worker consume preprocess_tensors, to prevent use after free + //! case happen + megcoreSynchronize(opr->handle()->megcore_computing_handle()); } //! handle weight preprocess -- GitLab