This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix use-after-free in record_btrace_start_replaying
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 20 Oct 2018 14:01:45 -0700
- Subject: Re: [PATCH] Fix use-after-free in record_btrace_start_replaying
- References: <20181019185840.532-1-tom@tromey.com>
On Fri, 19 Oct 2018 12:58:40 -0600
Tom Tromey <tom@tromey.com> wrote:
> -fsanitize=address showed a use-after-free in
> record_btrace_start_replaying. The bug occurred because
> get_thread_current_frame returned a frame_info, but this object was
> then invalidated before the return by ~scoped_restore_current_thread.
>
> This patch fixes the problem by renaming get_thread_current_frame and
> having it return a frame id.
>
> gdb/ChangeLog
> 2018-10-19 Tom Tromey <tom@tromey.com>
>
> * record-btrace.c (get_thread_current_frame_id): Rename from
> get_thread_current_frame. Return a frame_id.
> (record_btrace_start_replaying): Update.
LGTM.
Kevin