From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rbYCHp8e/GloxxwAWB0awg (envelope-from ) for ; Thu, 07 May 2026 01:09:51 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JCBIM9Jt; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 67A921E0BA; Thu, 07 May 2026 01:09:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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_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 098921E093 for ; Thu, 07 May 2026 01:09:50 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CDDE64BA23D0 for ; Thu, 7 May 2026 05:09:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDDE64BA23D0 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JCBIM9Jt Received: from mail-dy1-x132f.google.com (mail-dy1-x132f.google.com [IPv6:2607:f8b0:4864:20::132f]) by sourceware.org (Postfix) with ESMTPS id C517D4BA23C9 for ; Thu, 7 May 2026 05:09:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C517D4BA23C9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C517D4BA23C9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::132f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778130561; cv=none; b=LwsqMX3WfeKumwhz4o/mhxxYqpv48lbbrJexpsaEsF2plI9/Dr3Y8+1VY25qqYMPUCCnodXTEjEQ98V6Bm3RZ7+jEohd8kZ/4j3nuJDpdevIaw0rvpKtCu/ZEfoNt4VHtdn+beEQ8X++RRKD9Uu2jWqwK7vrwo/jnHKInunE8HU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778130561; c=relaxed/simple; bh=79FnNG++VAN+ovWRHWhAu1cMA9oWtR9pNGkanUr2xjA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=W/E4r45vBrkwBatz+R3fpJiXGd3Cxp8aVwBKHuYJKp5/wghifOCsIFsLGexOHu1T+LVyJte27ekQH1DbR3lY1YJRl2ehRlT107LwTOpGydR8cXVkVRQsrynPxoxYfWxGI7dCQkJFSvweOs3Bb+DY2axLsg7zWHwNo7r/xnuKPnk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JCBIM9Jt DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C517D4BA23C9 Received: by mail-dy1-x132f.google.com with SMTP id 5a478bee46e88-2ba9c484e5eso454357eec.1 for ; Wed, 06 May 2026 22:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778130560; x=1778735360; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XGMze/5U9EF2QmiKcO5cHVxEpa5yHfixuPi2KokJbsA=; b=JCBIM9Jt10Mljx7DKb6C6ji+SnYmlEGwEG9UGxUvL2zdeAiVL+w47FSn4FvxpevHZn 4pS0ggQD7ndxzyq/ZiS5wr1WV/GFSCLFw1GfMgbVsIjjTfyOGnyZAFiLCCB5C02sgwwu rVpYRlblZbWjvkFHPjH1WflTDJ5C6fROjNWTbSLYMFZkIOdo7mXt+SV+hCylDAikKBsr y18cv+kX/u+2f7zadrU335Q9f5O8tk1oquerFUtF/jg+L0z6YYzyOMQI8+pgGfQJ2AUF D1diLHppxfy88eAoJgosmXLSgOqW5dUGm82GFA2tXjnXmodnbDomrAVpDl7PrC5b5q1Q DfaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778130560; x=1778735360; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XGMze/5U9EF2QmiKcO5cHVxEpa5yHfixuPi2KokJbsA=; b=bRwI5jg72ux73RKEG+7CTKMunk3wWS6DyuwXqx4rVZT1LflFIJlTuYyjzrzw66wI3M 8kI6Up5L3afVgOCD8PaVEZdM97FYhCxqaraOPiC+n228ky+ihq3lnmPtMrGSwiO0Xwt6 BDlWxxu74i4VKHDM0+Xr6zZIuAmGn7sGxOvXcOCNoS1VD/4DzcI8GiJc/kGxRI07tykJ WnyP+85SOC7a/uTFFIwNdWe8qw3KWDupNZjl5t83l1Vm3i6gogSocJojagM+75fvZzxr DfTTvIv3oS9A5WcY/S0sfZqDXDSlDau2zpx7rWqjIGkg0Mmvraw9xugcRRxw5jSDZCyv tGYA== X-Gm-Message-State: AOJu0Yztcmhur4WclS71eOFdG55Ki+CZ8ZyxbHl/OApCQ2/yvl1WYVH0 VW8g/cliMroDti78m2KA2YU8ASIgnC/422rmG0aOx1rXCvL7/zSVBNjO1Vx7JyZ17Ls= X-Gm-Gg: AeBDievSOIVyAMGnCWPRbRqLspHEdQ48LwwUEttlqTu2IsYw5HfnDBVXSSyA3h7SdXr vDQilBkVJpLEUZ3KZE1hpeW2s4xbvInvJ/4bcdoXlRmX6/wSyKLplQCiGhUQfq8ODGcYlCdqss+ 9OpEmx0BZ2t3iZTeJjVcGInQYS04u1G4yD5gusgCV/HzARjta4eDk3ndYBS8geQ2xlNNnzkyMsD wM96t34jC/GxeFYaThySACpV0qiCBBWRVIVLjXcNygS9yLuiJVvebOWgETemsKqbkESbaPgw+Qz s/Lg59U1eDgtNP+6Gdmx4na6WAQnGHb8DAIyfKBTGaG3FnPPdtinoYfOSl9doBC30SXWZWoSXzd mZFhgX30rjq5hKIE4Xo6+d82u5NQKxt/0NCTI45BCSAuUQuAlQk4+9DkZusN+Xt6QqelAqUhhK7 EkPRcqWWE9sFdkfw0r3SkWXSqflA== X-Received: by 2002:a05:7300:a887:b0:2ed:e14:42ea with SMTP id 5a478bee46e88-2f54b57e193mr3292840eec.35.1778130559493; Wed, 06 May 2026 22:09:19 -0700 (PDT) Received: from localhost ([2804:14d:5c5b:48de::33b7]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2f56cec592asm7156011eec.5.2026.05.06.22.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 22:09:19 -0700 (PDT) From: Thiago Jung Bauermann To: Christina Schimpe Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 0/9] Add new command to print the shadow stack backtrace In-Reply-To: <87se8397qc.fsf@linaro.org> (Thiago Jung Bauermann's message of "Thu, 07 May 2026 01:14:19 -0300") References: <20260123080532.878738-1-christina.schimpe@intel.com> <87se8397qc.fsf@linaro.org> User-Agent: mu4e 1.14.1; emacs 30.2 Date: Thu, 07 May 2026 02:09:16 -0300 Message-ID: <87mryb956r.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 Hello again, There's always something more after you hit "send"... Thiago Jung Bauermann writes: > I had a look at the review threads for v1 and v2 of this patch series, > and I think the discussion below cover the loose ends that were still > unaddressed. Of course, thank you for having summarized the loose ends. It was very helpful. =20 > Please let me know if I am missing anything, or if there > anything else you want to bring up before posting v3. It turns out that there was this matter from patch 7 in the v1 thread=C2=B9: ---- >> My only comment is that there a also the "set backtrace past-main" and "= set >> backtrace past-entry" options, which "bt shadow" should also respect. S= o if >> the former setting is on, the output above should stop at frame #3. > > Ah those settings, ... I tried to add past-main/past-entry but stopped at= some point, > since it turned out to be complicated - but I don't remember the exact re= asons. > Do you think I missed something and adding those settings should be strai= ght-forward? I don't actually know. I would try to do what inside_main_func and inside_entry_func in gdb/frame.c do, but if that is what you tried and it didn't work or was too complicated then I don't have any ideas... inside_entry_func in particular seems tricky, since it uses get_frame_func which at least from a first look does appear to be complicated. > I then decided to first post the basic functionality of "bt shadow" witho= ut support > for past-main/past-entry. Do you think this is a problem ? I don't think it's a problem. ---- And there was also this part from your latest reply in the patch 6 thread that I forgot to paste and reply to: ---- > In case the normal backtrace is broken due for instance a programming err= or > such as a buffer overflow the user can use "bt -shadow" as alternative. = In that case,=20 > implementing frame arguments would probably be helpful, too. But if we do= this > afterwards, we'll change the default behavior of "bt -shadow". On the oth= er hand, > this series is already big enough... > And, if we go that direction, I wonder if we shouldn't somehow construct = frame #0 > for the shadow stack. But as described above, I've also some concerns for= that. > > What do you think? I don't think changing the default behaviour of "bt -shadow" between printing and not printing arguments would be a problem, because the output is meant for human consumption. With the MI output it could be a problem? I'm not very familiar with MI to have an informed opinion though. Regarding printing or not frame 0, in the case where the normal backtrace is broken due to stack corruption, can it happen that GDB doesn't print frame 0? I think it will because frame 0 is just the regcache, so doesn't depend on the regular stack. But I haven't checked how GDB actually behaves in this scenario. But IMHO this is not a good reason to construct frame 0 in the shadow stack backtrace. :) ---- --=20 Thiago =C2=B9 https://inbox.sourceware.org/gdb-patches/SN7PR11MB7638197A9C59562378= CA63D9F9C9A@SN7PR11MB7638.namprd11.prod.outlook.com/