Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp730538ybz; Sat, 25 Apr 2020 03:05:13 -0700 (PDT) X-Google-Smtp-Source: APiQypK/LO+Lck1XF95f5u8dcV7rt7WUXkEja2cgmPdmszSv9MHAT29/reRIf67p415epRrLm1uA X-Received: by 2002:a17:906:72c8:: with SMTP id m8mr11555542ejl.318.1587809113602; Sat, 25 Apr 2020 03:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587809113; cv=none; d=google.com; s=arc-20160816; b=JCiN+Wzy2UWxCjTey16L5JycQlqTRY3cdTvAnpnN5BDfyXXA9GM/liFJ5esbD2k/4c GFMPeu0FDcpQb/XhxD0uC+E1V9gs4oWIIVLCv7siW1x+l/Si4Y9DhOXqcO8mw0Acdqcq yv0a9oADlUlY5r4DjaajJcX2clufqdyfYLd3omjxhy7FJC496i2NQ/h/x9jl3MCYijmP R0SF5TKQuIpJejDJ4R0KPyS4T2DQNxLZlt4gmeYrTlGbmIrNB9Kzdb7EVeGyZN4F5J5R DSTnkxRVIh07sX9G0lvxpd/fbkVE0/bIH0GRMdJC0KFrzmK+881JtoNBk4HXvJ+PGMPj PIQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hzFlafVbguPCTGsWYTBA2MqvtcW1IOj7wGDJ/qclM6c=; b=Tw7Xwy2DnLMD3T5scuUe03mFwa1xuSyO3Y9ml4QqQaHXwrIqZlE3JFtkVe1FsvPA5u W7YBI7JvyQv48P+8Hv7dcCi6Bh6x4ehHWU+QKR1Vp8wEtO9U4Wq5HA/Fi8CR5lMuhyDA /xyN7W/uZ0pl6xjoF0VGSodeiJcPYeDacGvRaM8mASOAPirpQbAGG7/l2Sb75lQeyl+g W3lU2fNkK6IGGVsV77KQojqcdpfvQZB+Lu044xsJAU48CiMk46PZZqUlBz5gDshF/Cx0 rNZ8zeLx49I/0YOAKzYszmld/K8rcxaNDxGKIBKXXrTzjczWnDHCBUavkR+Ckltim2q8 FNug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SQT1yJIW; 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 c90si5149639edd.306.2020.04.25.03.04.50; Sat, 25 Apr 2020 03:05:13 -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=SQT1yJIW; 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 S1726060AbgDYKD1 (ORCPT + 99 others); Sat, 25 Apr 2020 06:03:27 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:60806 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726022AbgDYKD1 (ORCPT ); Sat, 25 Apr 2020 06:03:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587809005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hzFlafVbguPCTGsWYTBA2MqvtcW1IOj7wGDJ/qclM6c=; b=SQT1yJIW9W7+LA+LBxMLwgktf8K6BGpl3E1Uxdl3fouBBmF+ikLEjbsNiSb0sV4X4paN2p 3fmI1nIPFgPIO6RCJFN0J7f3c9bpwSM3OhlPrFRe3iwDXD9VGd+sYkNcXt3l+Hxpnw3z+p SpSgy0TheNkOxQRrU8QTYKXdfm8v5Zk= 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-361-Vn_BDqwSOXSKzUoVY-oMwQ-1; Sat, 25 Apr 2020 06:03:23 -0400 X-MC-Unique: Vn_BDqwSOXSKzUoVY-oMwQ-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 15FED180F125; Sat, 25 Apr 2020 10:03:21 +0000 (UTC) Received: from treble.redhat.com (ovpn-114-29.rdu2.redhat.com [10.10.114.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B1146061E; Sat, 25 Apr 2020 10:03:19 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Vince Weaver , Dave Jones , Jann Horn , Miroslav Benes , Andy Lutomirski , Thomas Gleixner , Steven Rostedt , Vegard Nossum , Joe Mario Subject: [PATCH v2 01/11] objtool: Fix stack offset tracking for indirect CFAs Date: Sat, 25 Apr 2020 05:03:00 -0500 Message-Id: <853d5d691b29e250333332f09b8e27410b2d9924.1587808742.git.jpoimboe@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the current frame address (CFA) is stored on the stack (i.e., cfa->base =3D=3D CFI_SP_INDIRECT), objtool neglects to adjust the stack offset when there are subsequent pushes or pops. This results in bad ORC data at the end of the ENTER_IRQ_STACK macro, when it puts the previous stack pointer on the stack and does a subsequent push. This fixes the following unwinder warning: WARNING: can't dereference registers at 00000000f0a6bdba for ip interru= pt_entry+0x9f/0xa0 Fixes: 627fce14809b ("objtool: Add ORC unwind table generation") Reported-by: Vince Weaver Reported-by: Dave Jones Reported-by: Steven Rostedt Reported-by: Vegard Nossum Reported-by: Joe Mario Signed-off-by: Josh Poimboeuf Reviewed-by: Miroslav Benes --- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 0d500767009b..0c732d586924 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1550,7 +1550,7 @@ static int update_cfi_state_regs(struct instruction= *insn, { struct cfi_reg *cfa =3D &cfi->cfa; =20 - if (cfa->base !=3D CFI_SP) + if (cfa->base !=3D CFI_SP && cfa->base !=3D CFI_SP_INDIRECT) return 0; =20 /* push */ --=20 2.21.1