From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3D52C3858D37 for ; Tue, 9 May 2023 17:48:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D52C3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 922BB1E0D6; Tue, 9 May 2023 13:48:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1683654533; bh=Y/slQsW/DQ8JpG3x4zHQny6MKNFD9jeXIfaPcWfw6L4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gPtDzhga7LrZAjdCCx2ilM0UR0HkKw/MoYwcDA0NRLl65+aiKEtWOYgoaXrA3fsEF 989k4h/tD1wsl5kcuj1MSbnUpQP0+HB7X2ni9xgnDySeyzVFwKEVIY3UrEkZJNjNnV pX2NRJiVdSTVw7yJBBSwH3iUYv22JELHjIDTKgB4= Message-ID: <85aa7f8d-a189-6c1a-2d46-f8ed6f9fbc9e@simark.ca> Date: Tue, 9 May 2023 13:48:52 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] gdb: fix use-after-free in check_longjmp_breakpoint_for_call_dummy To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20230508145913.29359-1-simon.marchi@efficios.com> <87cz397fgt.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87cz397fgt.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 5/9/23 10:21, Tom Tromey wrote: >>>>>> Simon Marchi via Gdb-patches writes: > >> Commit 7a8de0c33019 ("Remove ALL_BREAKPOINTS_SAFE") introduced a >> use-after-free in the breakpoints iterations (see below for full ASan >> report). This makes gdb.base/stale-infcall.exp fail when GDB is build >> with ASan. > > Sorry about that. > >> The new code kept the B_TMP variable, but it's not useful in that >> context. We can't go change the next breakpoint as saved by the safe >> iterator, like we did before. I suggest fixing that by saving the >> breakpoints to delete in a map and deleting them all at the end. > > Looks good. > > Approved-By: Tom Tromey > > Tom Thanks, pushed. Simon