From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fLNbKz8x1WoDYCwAWB0awg (envelope-from ) for ; Sun, 18 Oct 2026 16:51:11 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PYPFP/xk; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9F6551E04E; Sun, 18 Oct 2026 16:51:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 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 8034D1E04E for ; Sun, 18 Oct 2026 16:51:10 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 403124BA2E37 for ; Sun, 18 Oct 2026 20:51:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 403124BA2E37 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PYPFP/xk Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 36F144BA2E23 for ; Sun, 18 Oct 2026 20:50:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36F144BA2E23 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 36F144BA2E23 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792356642; cv=none; b=ek1biwrzFfOjubY/2zf8PmayZrJCd5BveVOHKxu+S8qYobCNvvwcb/TLyRPubwi3HGiZJw4K/NDfN2BaEJBiU8MUz1nECgnft+Vs0t4f71DZIZwQgO+vWf0CKtJKW43vWns8US8B0d9dVtvvgwdI4rwNcRbPfXfo69UiOAd+904= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792356642; c=relaxed/simple; bh=Js+DG6walBK5GxAe8eGe1JrCq4Y+aRbH9ol6JDuarGQ=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=boDcJBFTSsftCiRCPyLrePAf41+2sV663EQJvjdm5XK/gYC+fGM3MPACr1vIdJ6l5AAGPAXxsMuKOTv9ll/cQa1ZxlzdCW/0WqnIUo8dy0Cit447t5Y/tVyuEIRq4GTMT0xu8HQTkPLoeuCiLQ4QANR7kxBCl7gH7I9PTvJ7hZU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PYPFP/xk DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36F144BA2E23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792356641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FZs07WUZYjEq6tkpoZQ0cCfOXVcT2dEgyUev3Ad4S0g=; b=PYPFP/xk1GbT9frp45wNNvTKLPXHeODIiN25f56iAeGJuO4yk+ywANwd7cQXWDV595aO3u OyONJgKLn59pEpbRJpcRcHXH20w6rtLM70IOhJDDi8/X31y1ZfphfGQc78WekVu3IljHRv wS1aHs/E+2xI82K3/OEOULbMUO5sALc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-fDGXI_BtM0efG_qnbUa5CA-1; Sun, 18 Oct 2026 20:50:40 +0000 X-MC-Unique: fDGXI_BtM0efG_qnbUa5CA-1 X-Mimecast-MFC-AGG-ID: fDGXI_BtM0efG_qnbUa5CA_1792356639 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4a0284121c6so10528095e9.3 for ; Sun, 18 Oct 2026 13:50:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792356639; x=1792961439; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=FZs07WUZYjEq6tkpoZQ0cCfOXVcT2dEgyUev3Ad4S0g=; b=y51wm2DQ5J99C7jjEUlQlYWlob7r2ipSzUIC0YiBryoSNJ540scI7ynGsOBqTyX7mM yXzo3/Lt/mRXTd8gG6qPnoOV8t8//WJlZHXMFE9/ohiW6sfiX+s4bdIUpCpNPK1krHhV RsNEdC6OHwbHlpBBgR2+k5mn4GC0qDJKL6W9zo3j/RPeJUtqHUEskObaU7yL+Y1vWF3o YJXg1uMeagakftCmnHiYjm8Eg9fOZxtgAzT7CvnYRfeBtWnzDyB/TkxGQ7S7LE88zjg+ aIZKd7lFWBU3FDEYKADoapaHFMJKaDaSy8d8w4WKs7sgS96lxgLdbYWGMXF3ZzTfjbpP LhwA== X-Gm-Message-State: AFq9FYIBm1uqxZ5V3dymBdoD0n3fsHgfaWenGgQwgVRXnKoSZLPhQUJE 7NUc5ahFlEO10sH4LqzH10MdbDdGfCL+DVHhu4vqKpzvz0toyDuDxbeTdOGtaFtNSjwl/pJBfA0 Jh10VoVzrySXiuNL0cf1fw4nnURq/vBy1tz/aTIM0wrXwjHakoLTbs67xBf6WdGHOJ8tRvWVnrN DUvEfb+REgQAqeCpsq0QB8MQXMCj2KGADEjaUXst64xenCDuI= X-Gm-Gg: AYBFou0v7cvwmsTznHr+taHiGDLfQMp9WY/wqZCkC6LveaUl8cg7E5ckXTwZQmYKEyQ 5CdsKrmxgfaoNztkW0bxXNVJcm7iNbXRYR149j1+VCBR7Q1ONfsxa39pNAAutHWAYTAX1Xb468e GYNBWoCrszlLT/3Ms3cxlrXAwBpG/ndIi6S3hwa8BNBNKih00offf5PQ43tkowXBLImRoqZUrxo URjFEoiU6AMCkpphxIn9ENJ9uxYr6j6Nqrncv1r+pgb6F61sl8YTu+QS55TmOXok1+lOxnQTdir GWH8OaYEfxmxXi//hHLopiUjfPWgZxDZOx6MDxSbL+GnqTxcf8OUHH1k3HZavt21EWDq X-Received: by 2002:a05:600c:4e8a:b0:4a1:cedc:ab51 with SMTP id 5b1f17b1804b1-4a1d76315d7mr134538355e9.35.1792356639322; Sun, 18 Oct 2026 13:50:39 -0700 (PDT) X-Received: by 2002:a05:600c:4e8a:b0:4a1:cedc:ab51 with SMTP id 5b1f17b1804b1-4a1d76315d7mr134537935e9.35.1792356638759; Sun, 18 Oct 2026 13:50:38 -0700 (PDT) Received: from localhost ([213.31.44.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a1c8a81587sm433798465e9.1.2026.10.18.13.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2026 13:50:38 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 0/6] Improved error handling for .gdb_index parsing Date: Sun, 18 Oct 2026 21:50:29 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: vQTYnISnXQEioZ183NvlQy_4rhteaPoN7GkXmrX-vsM_1792356639 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 This started with Simon pointing out that one of my patches would create an invalid .gdb_index, which when read back in would cause GDB to crash. After fixing my original patch, my second take away from Simon's review was that GDB really shouldn't be crashing when presented with an invalid .gdb_index. Having looking through our .gdb_index code the error handling is pretty minimal, we mostly assume that the incoming .gdb_index is correctly formed, which we really shouldn't be doing -- it's extenal input to GDB and we should treat it as untrusted. I certainly don't claim that this series fixes all the bugs in our .gdb_index parsing code, but it does fix a number of pretty obvious ones, and adds a mechanism for generating .gdb_index sections to our DWARF assembler, so future bug fixes should be easier to write tests for. Feedback welcome, Thanks, Andrew --- Andrew Burgess (6): gdb: a number of fixes for .gdb_index parsing gdb: handle incorrect CU size in .gdb_index gdb: validate the CU vector offset when loading the .gdb_index gdb: address table parsing fixes and tests for .gdb_index gdb: handle corrupted .gdb_index header offsets gdb: extend .gdb_index tests to skip all data blocks gdb/dwarf2/read-gdb-index.c | 212 +++++- .../gdb.dwarf2/gdb-index-corrupted.c | 47 ++ .../gdb.dwarf2/gdb-index-corrupted.exp | 679 +++++++++++++++++ .../gdb.dwarf2/gdb-index-tiny-header.S | 49 ++ .../gdb.dwarf2/gdb-index-tiny-header.exp | 121 +++ gdb/testsuite/lib/dwarf.exp | 709 ++++++++++++++++++ 6 files changed, 1802 insertions(+), 15 deletions(-) create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-corrupted.c create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-corrupted.exp create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-tiny-header.S create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-tiny-header.exp base-commit: abcacfa2875d31480637ac082ce4862d518992f2 -- 2.25.4