From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4397868 for ; Wed, 3 Nov 2021 08:38:51 +0000 (UTC) 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=JsSCd4BUHuy7v+Nl/hcJhjaRwZ5I4g7Y8Z+ohPTpfsQ=; b=sOFEALajwKbrh4NJXZglhMjojt sslQXZ6An3xS/C5R4ixgCsmtppAP2XYyjf6b+umCO0YCJ4Q9vocClZkgKgu767KW7hmBIWoCiwqH/ SJem8ZBkFM3C0RhR4e8SmS5GwsFSdX0VQUpf5vyP6aH8thGxQw4HwE58snW4k97RxqQuHhOLKP7Xq lWJTy4x6UO20nW2URnTbs2k5GMR87vi5jrbWcdHPnWESyp3ZaVAcYoCsDo0mRGojnkOCgKGeKgxUF 15kUPASdSFIG+XRyerIRFVGDKbdmKvWSfNZMG/6idh2SoXYBar2S7Rn9tuCjRQ1EDUaiETM21lcgV D/95v6Tw==; 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 #2 (Red Hat Linux)) id 1miBkW-00550p-6T; Wed, 03 Nov 2021 08:36:35 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id C745F986378; Wed, 3 Nov 2021 09:35:59 +0100 (CET) Date: Wed, 3 Nov 2021 09:35:59 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Kees Cook , Ard Biesheuvel , Sami Tolvanen , Mark Rutland , the arch/x86 maintainers , Josh Poimboeuf , Nathan Chancellor , Nick Desaulniers , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, Linux Kernel Mailing List , llvm@lists.linux.dev Subject: Re: [PATCH] static_call,x86: Robustify trampoline patching Message-ID: <20211103083559.GB174703@worktop.programming.kicks-ass.net> References: <20211101090155.GW174703@worktop.programming.kicks-ass.net> <202111021040.6570189A5@keescook> <90a14299-ce56-41d5-9df9-f625aae1ac70@www.fastmail.com> <202111021603.EDE5780FE@keescook> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Nov 02, 2021 at 05:20:05PM -0700, Andy Lutomirski wrote: > I think that's a big mistake -- any sane ENDBR-using scheme would > really prefer that ENDBR to be right next to the actual function body, > and really any scheme would benefit due to better cache locality. Agreed, IBT/BTI want the landing pad in front of the actual function. > But, more importantly, IMO any sane ENDBR-using scheme wants to > generate the indirect stub as part of code gen for the actual > function. Sorta, I really want to be able to not have a landing pad for functions whose address is never taken. At that point it doesn't matter if it gets generated along with the function and then stripped/poisoned later, or generated later. As such, the landing pad should not be part of the function proper, direct calls should never observe it. Less landing pads is more better.