From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0QG4ICVIPWol+xcAWB0awg (envelope-from ) for ; Thu, 25 Jun 2026 11:24:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1782401061; bh=qLnR6ex8FWkYN81MItGqT59st9SO9ZIriTfJ1G9JLy8=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bb4gaq1Rmg9dgcxai61XESvxVJOvD7nY3vR41g70Ulsd3qIKszTn9dsQs9w22VD+i b+hnJyqCxpceVCakeWpVyAuB8ZxbNJxjA34iHNY9P+ITyaQ3WyoUfnfDydQdvnhGjl bguQ05oR3oPfBlFdHErT/hQtcOy5ropCgBhfWlZE= Received: by simark.ca (Postfix, from userid 112) id 812DD1E024; Thu, 25 Jun 2026 11:24:21 -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 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=nPQMsBa9; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 05F041E024 for ; Thu, 25 Jun 2026 11:24:20 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4EDD74BA23CC for ; Thu, 25 Jun 2026 15:24:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EDD74BA23CC 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=nPQMsBa9 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 0BB2C4BA2E29 for ; Thu, 25 Jun 2026 15:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BB2C4BA2E29 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 0BB2C4BA2E29 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=1782401034; cv=none; b=LPE22KFCo+kNQEAq0EDnOuYh72SfGgTOTuMl+xWcMWZWGmsLQEcSLvrn8d6BbL6o35BTkhPStSMPJPpM+dVfd/ksM6Mwh7Yd2F6g/zHT7XKXR1CixvTFOVpcTXwzPocWTX9rlVYBOSkKvX6tXBerT/pGgjkAdh1aYE7BPsdiczM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782401034; c=relaxed/simple; bh=qLnR6ex8FWkYN81MItGqT59st9SO9ZIriTfJ1G9JLy8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=jI+Um+IUjsDvkbic1INf9HE96QvgpEWsH2FND7Ruh8qickKG7uRq/fXAqTkqsEOc/JnPDc3uPgAsBeXR6tpDH8MYf/LK7apBgejM8SjnVc2kQ0KNoHrWxE8ehVpUA8AmTNen3Oj7SLaeGMeAGhtD7ALzorZJFzq9algGmPMhZ0A= 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=nPQMsBa9 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BB2C4BA2E29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1782401032; bh=qLnR6ex8FWkYN81MItGqT59st9SO9ZIriTfJ1G9JLy8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=nPQMsBa9ArI64z3sFCGjAP1oQ1NJckMOYzz2O/kcyTwDf1yI35mfdKi9xpGeHj/Og Ft2hF99qbm9+akVCHO8Ib4pp4QDB91Bg8cbW1tMj8SThuDCYwwiiHjRjyaln9BzXAb g/ns5tqplUgtAgsj9nkHq/DC3tNS/NSgk2hZ2qLY= Received: by simark.ca (Postfix) id 0DC851E024; Thu, 25 Jun 2026 11:23:52 -0400 (EDT) Message-ID: <4cca4550-44a8-45e2-9229-2aad030f1bc0@simark.ca> Date: Thu, 25 Jun 2026 11:23:51 -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: Jielun Wu , gdb-patches@sourceware.org References: <20260618180158.2893540-1-firmiana402@gmail.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <20260618180158.2893540-1-firmiana402@gmail.com> 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-18 14:01, Jielun Wu wrote: > Some DWARF expression opcodes read fixed-width operands or block payloads > from the expression buffer before checking that the bytes are available. > With a malformed expression, this can read past the end of the expression > buffer. > > Add helpers that validate fixed-width integer reads and block payload > skips, and use them in dwarf_expr_context::execute_stack_op. Also guard > the nested DW_OP_entry_value parser before reading the following opcode. > > Add a DWARF assembler test that exercises truncated operands for these > opcodes. > > Tested on x86_64-linux. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34239 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34299 I'll look at this patch, but before anything else, do you have a copyright assignment on file with the FSF? This is required in order to submit a non-trivial amount of code to GDB. See here for details: https://sourceware.org/gdb/wiki/ContributionChecklist#FSF_copyright_Assignment Simon