From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SHczB5Tq2Gqe8QUAWB0awg (envelope-from ) for ; Wed, 21 Oct 2026 12:38:44 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=e0AKt6S/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 056BB1E04D; Wed, 21 Oct 2026 12:38:44 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 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 B58891E04D for ; Wed, 21 Oct 2026 12:38:42 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73BAD4BA7988 for ; Wed, 21 Oct 2026 16:38:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73BAD4BA7988 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=e0AKt6S/ Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 27ABE4BA23E1 for ; Wed, 21 Oct 2026 16:38:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27ABE4BA23E1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 27ABE4BA23E1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792600697; cv=none; b=N+/68eDlav5pFtEI6lxdJBVhC/ODhWZRA8+D9kl8pUZw5JbSZqfc6gYId6RWeWNhA9YxqEs/unrEjNVRIg4/5fLbZID9lALbmiRVE7YO+HGAbkMXkS4bbBswozyff9FEa9Jt7KLBfOaGaJBL7Qi3Ibzqb18Wv6DhoC78w3tg4vo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792600697; c=relaxed/simple; bh=yMO+7G34xyPAXrS3Kh4puKHfugnD/xSmwywcalv9dQU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=aZ/Cks8RTABi6hB1caT15xmKAHW9xgYhXqb4ziWuT+0Zrla6uOogfbqJDICYjFfjmer3f/ZRTTLgBzovTkZIAeNanrdpjOWw7Dws5VVHlAGJbWC+1QvaOJ16CRwARrrypE46LuaRBL+CnbWrDj5QbjiIc19UbMFTZJUNlAJ36zM= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=e0AKt6S/ reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27ABE4BA23E1 Received: from eig-obgw-5007b.ext.cloudfilter.net ([10.0.29.167]) by cmsmtp with ESMTPS id JYpUxPPcnusRSJZKRxFcYE; Wed, 21 Oct 2026 16:38:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id JZKQxKUragNihJZKRxyI82; Wed, 21 Oct 2026 16:38:15 +0000 X-Authority-Analysis: v=2.4 cv=G78cE8k5 c=1 sm=1 tr=0 ts=6ad8ea77 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=660iZSQnnn4A:10 a=ItBw4LHWJt0A:10 a=QyXUC8HyAAAA:8 a=zstS-IiYAAAA:8 a=JmnMxqwMx_6xjsta8S0A:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CjWP4Zi27g9H5KUs2FFTpyv2B/T4dsRLMBmsQfNZbn8=; b=e0AKt6S/t0ihFyrCoaRDrzmK7l ZY97iyIA02VKgPafYLLwzj/G27ErH/d5UH2y1Y086SOUQXwLzmS06BaTnney8USt40djdWG3jg0yh eS92A3ZHdt4Zb4/7RAX/qnNrV; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:40722 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xJZKQ-00000002jIS-14Rx; Wed, 21 Oct 2026 10:38:14 -0600 From: Tom Tromey To: Stephan Rohr Cc: gdb-patches@sourceware.org, tom@tromey.com Subject: Re: [PATCH v2 1/1] gdb: fix overflow caused by value_print_array_elements In-Reply-To: <20261021113045.171468-2-stephan.rohr@intel.com> (Stephan Rohr's message of "Wed, 21 Oct 2026 11:30:45 +0000") References: <20261021113045.171468-1-stephan.rohr@intel.com> <20261021113045.171468-2-stephan.rohr@intel.com> X-Attribution: Tom Date: Wed, 21 Oct 2026 10:38:13 -0600 Message-ID: <87jynbypoq.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.129 X-Source-L: No X-Exim-ID: 1xJZKQ-00000002jIS-14Rx X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (bapiya) [97.122.110.129]:40722 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfKUYRHnCv/tVHD/jTJUyb49s4VkOmS8a0xeAjje0Oh1/KzqvohFg7j/b5rGXDgqY9yoC6ZefUm3E8sd589I4rAVfDc3xiPoHhdZpcl4A6rEVCprs25Rz FL/7n5cCDp64Lcbf0nS/R0Y7y6KVonHOfHQxN/5wxzjyrrC4TD1EjupsRKqzzsWbgAMYDRyHh7YBGa5/IX1BNMrURfm1AgjpvbY= 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 >>>>> "Stephan" == Stephan Rohr writes: Stephan> When printing an array whose stride is larger than its element type, Stephan> GDB allocates memory for each array element based on the element's Stephan> true type. The allocated buffer may include some padding. Stephan> "value_print_array_elements ()" passes the stride as the bit length to Stephan> "from_component_bitsize ()". This is silently swallowed if the stride Stephan> does not exceed the size of the allocated buffer but corrupts the heap Stephan> if the write goes beyond. Pass the size of the element's true type Stephan> instead. Thank you. Approved-By: Tom Tromey Tom