tracing service: Verify target buffers specified in commit requests
Adds a check to ensure that a producer's chunks are only copied into
buffers associated with said producer's tracing session.
Bug: 73828976
Change-Id: I7059da4b0e2fd9ff390f6aaee8fc8e4e5cc5fc59
diff --git a/src/tracing/core/tracing_service_impl.h b/src/tracing/core/tracing_service_impl.h
index 03d49ee..064706e 100644
--- a/src/tracing/core/tracing_service_impl.h
+++ b/src/tracing/core/tracing_service_impl.h
@@ -91,6 +91,10 @@
void Flush(FlushRequestID, const std::vector<DataSourceInstanceID>&);
void OnFreeBuffers(const std::vector<BufferID>& target_buffers);
+ bool is_allowed_target_buffer(BufferID buffer_id) const {
+ return allowed_target_buffers_.count(buffer_id);
+ }
+
private:
friend class TracingServiceImpl;
friend class TracingServiceImplTest;