From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52554 invoked by alias); 23 Oct 2018 20:06:22 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 51111 invoked by uid 89); 23 Oct 2018 20:06:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (158.69.185.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Oct 2018 20:06:20 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Fix use-after-free in record_btrace_start_replaying From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <79b8d3b090bcbfbcffa8bdd195476c6db172273b@gdb-build> Date: Tue, 23 Oct 2018 21:06:00 -0000 X-SW-Source: 2018-q4/txt/msg01784.txt.bz2 *** TEST RESULTS FOR COMMIT 79b8d3b090bcbfbcffa8bdd195476c6db172273b *** Author: Tom Tromey Branch: master Commit: 79b8d3b090bcbfbcffa8bdd195476c6db172273b Fix use-after-free in record_btrace_start_replaying -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-23 Tom Tromey * record-btrace.c (get_thread_current_frame_id): Rename from get_thread_current_frame. Return a frame_id. (record_btrace_start_replaying): Update.