Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4030907pxk; Tue, 29 Sep 2020 12:20:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwte8oL7hX93sjpDGPJKznTljruE/VUdXf9gW5Fx2UlBt4EHc58Q45p36Sgid0aWv8NA0sz X-Received: by 2002:aa7:d585:: with SMTP id r5mr4966191edq.278.1601407241390; Tue, 29 Sep 2020 12:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601407241; cv=none; d=google.com; s=arc-20160816; b=tBmauV5u25wpkhkjdUGkwDb9Sr9ezBPkNusxUCKUr7dfdSzVg03cxMk9N7jN+0MuFm pUgEANZvkcErYILIyUb9FWPABZyixKxF6UMm+uwD7/MvjLArCbyaGYTnrySSvY3fnjQX 0guOTFGjlI6OyKVboygFIvQybAY9htb3I10PFc/plCzrx9g89mPGcCTWBKwcER/FUreZ stloWioTdow2Oytg22ojy9CJZ4oqAy/n88KDJ+yCXThgXWHxff1+1SYYMy0DpP3TohyR YqA78bKnbKbgRPaV1jCDI6N9cx3CZBE3C5QMkm7fgdImfdGnZph4/NR0gOCIew+XYfmS XxlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PwDF8sRN981dD8fydiaK/PhWhCr08TO1kfBL5+e7gjw=; b=SCnMnIQvhdRfkwBk+fM6w8FeSF1Kvzn/CjugdAGhvvaT0qoAv/O8Suxq/ZwX2B4xWe uI+pq6ts2jClofpi3d9PkHEwRMGxa6P/U/ZZl42MCMFQ5Ih06ypb71l0/ECYB2k8CvJ+ LmuUBseqc0i+jeenK+LcyhSkie+vF7gFn6nEUGZzUKbWa8sRB9e5cB88TzW6ubO9KIAm 2USzleMiRMX1lhwfeadtZ/ny4gRZwBC7Cy1Q15i9c+9Qet6LlcsjVGyfKHj2CYOtjl/G pnMqOb3oXhB56LN/6tzMbmvUhvLnp9ruKZ71oqyseeICxprZ60qwNR+SC4uNYN8B609P KIog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X4EEo2oZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si3299648ejz.749.2020.09.29.12.20.17; Tue, 29 Sep 2020 12:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X4EEo2oZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728602AbgI2TSp (ORCPT + 99 others); Tue, 29 Sep 2020 15:18:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43379 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgI2TSp (ORCPT ); Tue, 29 Sep 2020 15:18:45 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601407124; 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: in-reply-to:in-reply-to:references:references; bh=PwDF8sRN981dD8fydiaK/PhWhCr08TO1kfBL5+e7gjw=; b=X4EEo2oZNlI4Pg1lVOIq/NHpKU23xvh+Qsf85DfmS6TH1sdkpSLoSVgdxcBA+TdwRQdu9l mQGrJJzra4lUVhso69ffXBJ+SciJjChjPhkkEahlNQ48/8fLzoQQmgq/o0VWrOGlG98z60 2iiLgnkrVbw2eMj5ErIdQpalp0lmuv4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-8LXkHtqgOoW2pfy9EyuA1g-1; Tue, 29 Sep 2020 15:18:40 -0400 X-MC-Unique: 8LXkHtqgOoW2pfy9EyuA1g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAE36425CE; Tue, 29 Sep 2020 19:18:38 +0000 (UTC) Received: from treble (ovpn-113-70.rdu2.redhat.com [10.10.113.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11DAF7838A; Tue, 29 Sep 2020 19:18:36 +0000 (UTC) Date: Tue, 29 Sep 2020 14:18:34 -0500 From: Josh Poimboeuf To: Julien Thierry Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mbenes@suse.cz, raphael.gault@arm.com, benh@kernel.crashing.org Subject: Re: [PATCH v2 1/3] objtool: check: Fully validate the stack frame Message-ID: <20200929191834.7daofidv6b5aef3y@treble> References: <20200928093631.210610-1-jthierry@redhat.com> <20200928093631.210610-2-jthierry@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200928093631.210610-2-jthierry@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 10:36:29AM +0100, Julien Thierry wrote: > +++ b/tools/objtool/arch/x86/include/cfi_regs.h > @@ -22,4 +22,7 @@ > #define CFI_RA 16 > #define CFI_NUM_REGS 17 A few more naming nitpicks: > +#define STACKFRAME_BP_OFFSET -16 > +#define STACKFRAME_RA_OFFSET -8 "Stack frame" has more than one meaning now, I suppose. i.e. it could also include the callee-saved registers and any other stack space allocated by the function. Would "call frame" be clearer? CALL_FRAME_BP_OFFSET CALL_FRAME_RA_OFFSET ? > +++ b/tools/objtool/cfi.h > @@ -35,4 +35,6 @@ struct cfi_state { > bool end; > }; > > +#define STACKFRAME_SIZE 16 CALL_FRAME_SIZE ? I'm sort of contradicting my previous comment here, but even though this value may be generic, it's also very much intertwined with the CALL_FRAME_{BP|RA}_OFFSET values. So I get the feeling it really belongs in the arch-specific cfi_regs.h next to the other defines after all. -- Josh