From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37EDEC433C1 for ; Tue, 23 Mar 2021 22:15:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDA94601FC for ; Tue, 23 Mar 2021 22:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233684AbhCWWOx (ORCPT ); Tue, 23 Mar 2021 18:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233870AbhCWWOP (ORCPT ); Tue, 23 Mar 2021 18:14:15 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59811C061574 for ; Tue, 23 Mar 2021 15:14:12 -0700 (PDT) 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=RaxNNs9Y6YIP76zp1wZIN6hp64KantReS4YHOC/0Lb4=; b=AD3md6kqD/tIebIf3OYFWMZBhN 1wmzO/parNLgQqH8hEa+7UE/mPII11see+eI/pqDCjmlU8NG8s2NEa1tpIdQlPPvppGKMSaLrXMFL CM5GON1g7qWhAvOewMZgNS+uKjJEk5hBHzgPxjLcibjIA4e7xT6lzNXiNsCemRgnQRYQM7rLywXD8 defMXINDuKsJndlS2un1TxP/A4wV4y6g0pSaqnMR8fLHgO2kSIMuW0AW+diG/f9GsBgsILA88e2D4 3Tu6ZZuofpd1QvB47EaotUTcxQApUJ2QDfFjJSLr6LglOaqKbwTcdDp2pvmDWvVF3fdj+yH1N3ZvR XNNO727w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lOpGf-00Aakm-0U; Tue, 23 Mar 2021 22:13:07 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id B2ECE9864F6; Tue, 23 Mar 2021 23:12:46 +0100 (CET) Date: Tue, 23 Mar 2021 23:12:46 +0100 From: Peter Zijlstra To: Andrew Cooper Cc: Nick Desaulniers , linux-toolchains@vger.kernel.org, clang-built-linux , Steven Rostedt , "Jose E. Marchesi" , Kees Cook , Florian Weimer , Christian Brauner , nick.alcock@oracle.com, Segher Boessenkool , Josh Poimboeuf , Will Deacon Subject: Re: Plumbers CF MCs Message-ID: <20210323221246.GB5208@worktop.programming.kicks-ass.net> References: <20210323195358.GB4746@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323195358.GB4746@worktop.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Tue, Mar 23, 2021 at 08:53:58PM +0100, Peter Zijlstra wrote: > Another utterly disguisting option is to align all CALL instructions on > 8 bytes and have it followed by 3 INT3s to make it 8 bytes long. Then > have every function prologue round up the return address. This should > work with tail-call optimizations because the round-up is NOP when > repeated. The obvious down-side is that it will utterly wreck the RSB Slightly less horrible: "CALL func; INT3" + "INC (%RSP); RET; INT3". It still completely wrecks RSB, but isn't nearly as wasteful.