Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp599341ybz; Wed, 15 Apr 2020 14:53:29 -0700 (PDT) X-Google-Smtp-Source: APiQypIeGpLFjMYaWXL0Kp+/TYDzSrJtspSl3uRERAfhe9GtWFeWCatP1K/Lcoh2ogLJgS90EM0m X-Received: by 2002:a17:906:85d3:: with SMTP id i19mr6741280ejy.153.1586987608855; Wed, 15 Apr 2020 14:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586987608; cv=none; d=google.com; s=arc-20160816; b=fVgE+iNEjTgMY3tLHpW1zHpdPFQPgin7Pf5kBCNA6zUCy2QnSrfFRbOKACfRZBsy+f Q7bDjjmo43grjnp2z7P63liqIt5vgke+aKLBuoM5aL2YIyXE4vuwulgXISMmmq+IQM9g xjoMRldgOKgfrZC18On2SXdKeOmzjbF07ynG0+KZdPBjKo75Lsa/BddAbzFNi4a9cAn2 ZGyZqVWRvCWiRPPWRPr+OakFWZcIGwybj+mO4OC82/7CH2g4TbEvHuZlnfWzpl5IaR5Z dbax7pHBTIxs37azCz5qhwc94xIMYISuBEkOzgjv7W7wnMqAq9LYhUc9Evf7p2x3rVSe f5PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9vok3C1d2NVKjQ/zMjs0qD8eBUGaGr2I4zwLsLwFDMU=; b=Rd7tNcVTVBMHSsniCORH5RXevTvHvip6C8+K+zww2C9eCggP6TAgwrzNr6xPrLFPsn dXMqM/niIOgpAomOyUens6d7UchXWB/WoQfgHaD6BczbHG7cBK4j4nhDUEZHJz7rS8a5 PLLPwfiw5nUBpnTVYqgjtqODc1wz+Ku0OQcYJoqEOCtZp69B4x6vNMusrHfQeRG19bIm +Z2NAnQtUX0NtUpMsSHH7Biqe9eGS96DEjYN6ivVRxi/l5kbePzYi336toMH1gA6dG5T QmcU+XsDQjJdqwVHvqAdCw2/McDh+zwD76I0zc862GVYj4oaU+NrVOOKEGQk43sOQId/ Te2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YR0grewP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si11103872ejr.86.2020.04.15.14.53.05; Wed, 15 Apr 2020 14:53:28 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YR0grewP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505221AbgDNTtx (ORCPT + 99 others); Tue, 14 Apr 2020 15:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2505187AbgDNTsI (ORCPT ); Tue, 14 Apr 2020 15:48:08 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C38C061A10 for ; Tue, 14 Apr 2020 12:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9vok3C1d2NVKjQ/zMjs0qD8eBUGaGr2I4zwLsLwFDMU=; b=YR0grewPR3o/qBdW2F2EzZExHe WCuo8fyMPSarL/iOd9uBNfxjK0hp2HpNLQ/tLwbsIvfXjomTri0l+MvpZcoa4oWKkwEEbXBxBrqTV VYtFT5XC95c1fTAK+hPdyDprkFqzPekdFw12w8xxWLaXlINawBRfdRP2fabskPkq2TbN+9kHfR1VX WeVbxOh6tSiVvquBNIB4jKfO2t4Rx+E4tdFZEMWpyqj/cSR4zIszV7ra4q2th4W2vmR7yAUlS6I5r wG68C3sVCRhBs0+0AUlVr5zoor+r49e6mSi7j64LKKKoERR1yC67cqHf3X5S0RriSm7yGP5ahbIGo Ure0veDg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jORXP-0003eF-VO; Tue, 14 Apr 2020 19:48:04 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 2B2BD981086; Tue, 14 Apr 2020 21:48:01 +0200 (CEST) Date: Tue, 14 Apr 2020 21:48:01 +0200 From: Peter Zijlstra To: Alexandre Chartre Cc: x86@kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, jthierry@redhat.com, tglx@linutronix.de Subject: Re: [PATCH V3 5/9] objtool: Add return address unwind hints Message-ID: <20200414194801.GH2483@worktop.programming.kicks-ass.net> References: <20200414103618.12657-1-alexandre.chartre@oracle.com> <20200414103618.12657-6-alexandre.chartre@oracle.com> <20200414161636.GP20713@hirez.programming.kicks-ass.net> <546b2d81-39ca-00e1-4df2-d4eaa18496a4@oracle.com> <20200414175604.GD2483@worktop.programming.kicks-ass.net> <20200414184233.GG2483@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 09:27:27PM +0200, Alexandre Chartre wrote: > This provides a generic code to handle any intra-function call. Currently we have > the RSB stuffing ones which are forgotten with the UNWIND_HINT_TYPE_RADDR_DELETE > directive. And for retpoline, they will not return if we have an indirect jump > (JMP_NOSPEC) but they will return if we have an indirect call (CALL_NOSPEC). The > code can handle both cases. For example, if we were to have a CALL_NOSPEC invocation > which is not in an alternative then objtool can now correctly handle it. The specialness of CALL_NOSPEC goes away with my proposed retpoline rework as well. I really don't think we need something as complicated as this. Fundamentally validate_branch() will continue after a CALL instruction; so I'm thikning the worst that can happen from not following a (theoretical direct return) is a false-positive unreachable code warning, and we can trivially fix those with exisiting hints.