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: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Tom Tromey <tom at tromey dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 22 Oct 2018 06:46:57 +0000
- Subject: RE: [PATCH] Fix use-after-free in record_btrace_start_replaying
- References: <20181019185840.532-1-tom@tromey.com>
> -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.
Looks good to me.
Thanks,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928