From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 878MD36LPmobUxkAWB0awg (envelope-from ) for ; Fri, 26 Jun 2026 10:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1782483838; bh=74Ndu86rOqoacIr9vCDM3FNNNYnbXtCzurzlTzWo0Dw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=L/Bq+pBkP7imBOOZ6Yrz9VO0GXKKMV1gmMx8OiQ+rBiVwdbWjWtzKi5WYOPeBJ/po 8apZP5Iy91O1GMjl8mAJjTUr2jY07OwHcRIpuZD/or4aEhclyL6QM3+hjzzPjudJ8o 8Pa1B+WbnD2Ra2PttRtnIAFSmZSCQQI9nG1STUQw= Received: by simark.ca (Postfix, from userid 112) id 23EC61E098; Fri, 26 Jun 2026 10:23:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=eW4FHymx; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6128F1E024 for ; Fri, 26 Jun 2026 10:23:57 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DCA2D4BA2E2E for ; Fri, 26 Jun 2026 14:23:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCA2D4BA2E2E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=eW4FHymx Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D87994BA2E09 for ; Fri, 26 Jun 2026 14:23:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D87994BA2E09 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D87994BA2E09 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782483812; cv=none; b=GEq+78lzBSfHbiVffc+f7mmyYDBROrm/kAfa8/NKGdm7yycyn3w/LmVo+eJefmrAuPF7WxWd3HP6My+Wo9HkRIJbB/X64JFJx90eql0Yfj12oM4FVkB3nYGy8kBAGarES+a8Sec7TmLCWlM9Dt7d5zyGnr36/mTvEFbxf23NAP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782483812; c=relaxed/simple; bh=74Ndu86rOqoacIr9vCDM3FNNNYnbXtCzurzlTzWo0Dw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=csEZO+tt2KncUAIMusyG8bcikaejI4hdDVBuv3v7WHg4egXOSfPhCwZZT6KHcdkyLJPfwJ3oa1BZ90zNMR1nBR7RDlx37WMY+GPq4ku4vEe40ClU+r2REmVsY19tLX3FGheGGWhobOTkiE9Se1kMAQbHHVkuFIVdxkKb0NkB/NI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=eW4FHymx DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D87994BA2E09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1782483811; bh=74Ndu86rOqoacIr9vCDM3FNNNYnbXtCzurzlTzWo0Dw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eW4FHymxaC65ANSst+AafxEJ8IqDJIg0D9HgfyBktc2X6Xz+kxS4d/cT5cyncYV5m XTRZ3qLH8ajwFAMaMPnePSzGfYCvJUCkEepPHEmNld/xkZfK33yBjgNgB0SM+oHIl4 I6WBhlekOs5eczW+VwT9pGpHk4Xh9e1O/7aQY5Uo= Received: by simark.ca (Postfix) id 3E6E71E024; Fri, 26 Jun 2026 10:23:31 -0400 (EDT) Message-ID: Date: Fri, 26 Jun 2026 10:23:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH][PR gdb/34239][PR gdb/34299] gdb: Check bounds before reading DWARF expression operands To: Firmiana Cc: gdb-patches@sourceware.org References: <20260618180158.2893540-1-firmiana402@gmail.com> <4c790bb0-a1cb-454c-8084-c6e2cfe8e3c9@simark.ca> Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-06-26 03:34, Firmiana wrote: > Hi, > > Thanks for the review. Given the amount of changes needed, I plan to prepare a v2 that > supersedes this version. Before preparing v2, I would like to clarify a few questions. > > First, regarding copyright assignment: I do not currently have an FSF > copyright assignment on file. I noticed the 2022 binutils announcement > that DCO signed contributions are accepted: > > https://sourceware.org/pipermail/binutils/2022-October/123680.html > > and binutils/MAINTAINERS documents DCO as an alternative to FSF copyright > assignment. Does this DCO path also apply to GDB patches touching gdb/? > If so, I will add: > > Signed-off-by: Jielun Wu > > > to the v2 commit. If GDB still requires FSF copyright assignment for > this patch, I am willing to start that process. Thanks a lot. No it doesn't apply to GDB. There are ongoing discussions to maybe use DCO for GDB too but we haven't reached a consensus yet. > On the technical comments, I agree with most of them and plan to address > them in v2: > > - make the helper comments more precise; > - change the `buf > buf_end` cases in safe_skip_bytes() to assertions; > - switch the new fixed-width integer helpers to reference/template > style, unless you prefer keeping them closer to the existing > safe_read_uleb128/safe_read_sleb128 style; > - add assertions that LEN fits in the destination type; > - remove the unrelated whitespace-only changes; > - change the dwarf_block_to_dwarf_reg_deref guard to the > `gdb_assert (buf <= buf_end); if (buf == buf_end) return -1;` > form; > - add selftests for dwarf_block_to_dwarf_reg and > dwarf_block_to_dwarf_reg_deref; > - rewrite the DW_OP_deref* branch using the explicit if/else form you > suggested. > > For the helper style: in v1 I mirrored the nearby safe_read_uleb128 and > safe_read_sleb128 helpers, which use output pointer parameters and short > "or throw an error" comments. But I agree that these new helpers can be > clearer, so unless you prefer otherwise I will use the reference/template > style you suggested for v2. Ack. It's good to leave the place a little nicer than how you found it :). Simon