From b7b2c294e07db11e83c8d0440cb9d0ccd353cc58 Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Thu, 18 Apr 2024 00:05:55 -0500 Subject: [PATCH] Update lib/rocprofiler-sdk/hsa/queue.cpp (#788) - fix heap-use-after-free --- source/lib/rocprofiler-sdk/hsa/queue.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/lib/rocprofiler-sdk/hsa/queue.cpp b/source/lib/rocprofiler-sdk/hsa/queue.cpp index 59da156854..a562e863c3 100644 --- a/source/lib/rocprofiler-sdk/hsa/queue.cpp +++ b/source/lib/rocprofiler-sdk/hsa/queue.cpp @@ -200,6 +200,12 @@ WriteInterceptor(const void* packets, void* data, hsa_amd_queue_intercept_packet_writer writer) { + if(registration::get_fini_status() > 0) + { + writer(packets, pkt_count); + return; + } + using callback_record_t = Queue::queue_info_session_t::callback_record_t; // unique sequence id for the dispatch