[lttng-dev] [PATCH lttng-tools] Fix: consumer-stream: use-after-free of metadata bucket

2022-02-25 Thread Vincent Whitchurch via lttng-dev
When consumer_stream_destroy() is called from, for example, the error path in setup_metadata(), consumer_stream_free() can end up being called twice on the same stream. Since the stream->metadata_bucket is not set to NULL after being destroyed, it leads to a use-after-free: ERROR: AddressSanitiz

Re: [lttng-dev] [PATCH lttng-tools] Fix: consumer-stream: use-after-free of metadata bucket

2022-03-02 Thread Vincent Whitchurch via lttng-dev
On Tue, Mar 01, 2022 at 06:19:23PM +0100, Jérémie Galarneau wrote: > Thanks a lot for reporting the problem. If I understand the ASAN > report correctly, the stream itself will also be double free'd, so > I don't think this is the complete fix. Yeah, it looked odd that consumer_stream_destroy() is

Re: [lttng-dev] [PATCH lttng-tools] Fix: consumer-stream: use-after-free of metadata bucket

2022-03-08 Thread Vincent Whitchurch via lttng-dev
On Mon, Mar 07, 2022 at 06:37:49PM +0100, Jérémie Galarneau wrote: > I had a chance to look into this and came up with the following fix: > https://review.lttng.org/c/lttng-tools/+/7478/4 > > Would you have a chance to try it on your end before I merge it? I've tested the patch stack in patch set