Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13848938pxu; Mon, 4 Jan 2021 06:14:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRoBcQCVOcjkcfgR4kbpIAJ0KyyVn38aDqwr9zdykTKVfEtftoRYr1dxApPSx/3evYaAQf X-Received: by 2002:a17:906:259a:: with SMTP id m26mr67984969ejb.399.1609769662097; Mon, 04 Jan 2021 06:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609769662; cv=none; d=google.com; s=arc-20160816; b=s95pBUS8Vcx0SM2uLyZ0FADi4AFLOTsQwUu0RNMLIOnoE5ktt56eWJIf7A2JV5gtpo TDqqM2CrP7vVu2Uoq4anl6xTGUt+TlhJIpyamOfuNHwjo0sCHdv+jU6Dts08lKmOBiDz FHU4S0VnJLr64RfEnyxxTgyxvwdIu4jNaFAIa1Ry6Z1xIuyEI9b7/NHGWAOopzdSKUme x1kS4ao121JfaPZO5Uw66C9SM5ZpQHxusrt8nPxMhdePHI6z68s0rnSSvpgqMD0AoFmf zJxc0alcUG2n7gIutzX6+OT8d5Xilo5va2gYMMGFSbYS8zQkx3M8E4H4ibcN0+ISZyMG Kp9Q== 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=a4nIuOPB7NGZ8PdC9/3vOs28zwMGea0v4ptxyiU4XUk=; b=WI6x+84XxBmZRZ6o9ua0rigg7+lnDF4gjZw8rgIsB4iWOac+5G+q0ki2bYj79HQkOz l1FVPQy0mhCT0XU0orMd/5+bTpspY6+i9WANpgHPpTae4ij1Yqb0KAjKdIuBjL3HdBpn zC1VMA7z3BlURgrJHWCo4yJVsnhy2xmCXG0qFvHbftA5b44Yzu1waNpDUPmwh2auY0wG lDRdPpPdTHhnM3lPieGpoCL+NUgDrzPFLwRmPuPNP9C8n/4e95u4Lmx9msmsh+19MCVY dYxmrzBwJ3TiCkLNKk4t60TNbbCmunU59XVukzclFBsJhaNH0bR5e60wlG0xY4619Br1 gsnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JvBOTXsK; 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 bd1si31124359edb.168.2021.01.04.06.13.59; Mon, 04 Jan 2021 06:14:22 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=JvBOTXsK; 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 S1727225AbhADOMc (ORCPT + 99 others); Mon, 4 Jan 2021 09:12:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbhADOMb (ORCPT ); Mon, 4 Jan 2021 09:12:31 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF871C061574 for ; Mon, 4 Jan 2021 06:11:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=a4nIuOPB7NGZ8PdC9/3vOs28zwMGea0v4ptxyiU4XUk=; b=JvBOTXsKEet40RlLCqk0Dc8kgX ozYvYdLqZof0hpKyyrYcTRocsOd+Y2Lzs8l2xMrrErXIybL7aVUu1C7RmJQEO37SBDyYbFULcf3yp aj7PGM1hnAzOx16RtPw47PAp01p5i+03GnvxPc15afuuAu1HcrspRVBLyuMrWpvOamrKCoDSCsUea TYz7qXg1E9gJo06MaKwCdVuayJP8z3AZMnlQdhmYLg/hdBzddGm+FrhSkRn2BJYxTQMkdKym8PonT fOj+9vFrulHq8RF3uN7deLHBxiRNE/9fJEK0YlbpQb5ONhBgqg0LF7roNm6x4itMwGa3UDOdsHnbl e7AvWcDg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1kwQYV-000ARY-9e; Mon, 04 Jan 2021 14:10:12 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 053F8306E0D; Mon, 4 Jan 2021 15:09:52 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C30E8201B21B4; Mon, 4 Jan 2021 15:09:52 +0100 (CET) Date: Mon, 4 Jan 2021 15:09:52 +0100 From: Peter Zijlstra To: Josh Poimboeuf Cc: Juergen Gross , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Miroslav Benes , Shinichiro Kawasaki Subject: Re: [PATCH 3/3] objtool: Support stack layout changes in alternatives Message-ID: <20210104140952.GQ3021@hirez.programming.kicks-ass.net> References: <9f78604e49b400eb3b2ca613591f8c357474ed4e.1608700338.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f78604e49b400eb3b2ca613591f8c357474ed4e.1608700338.git.jpoimboe@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22, 2020 at 11:18:10PM -0600, Josh Poimboeuf wrote: > For example, this scenario is allowed: > > Alt1 Alt2 Alt3 > > 0x00 CALL *pv_ops.save_fl CALL xen_save_fl PUSHF > 0x01 POP %RAX > 0x02 NOP > ... > 0x05 NOP > ... > 0x07 > > This scenario is NOT allowed: > > Alt1 Alt2 > > 0x00 CALL *pv_ops.save_fl PUSHF > 0x01 NOP6 > ... > 0x07 NOP POP %RAX > > The problem here is that offset-0x7, which is an instruction boundary in > both possible instruction patch streams, has two conflicting stack > layouts. There's another fun scenario: 0x00 CALL *pv_ops.save_fl PUSHF 0x01 NOP2 .. 0x03 NOP5 .. 0x07 NOP2 0x08 POP %RAX 0x09 No conflicting boundary at 0x07, but still buggered. Let me go read the actual patch to see if this is handled.