From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 EE2E91B8B for ; Tue, 15 Feb 2022 23:38:36 +0000 (UTC) Received: (Authenticated sender: joao@overdrivepizza.com) by mail.gandi.net (Postfix) with ESMTPA id 3EEEF240004; Tue, 15 Feb 2022 23:38:33 +0000 (UTC) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Tue, 15 Feb 2022 15:38:33 -0800 From: Joao Moreira To: Kees Cook Cc: Peter Zijlstra , Sami Tolvanen , X86 ML , hjl.tools@gmail.com, Josh Poimboeuf , andrew.cooper3@citrix.com, LKML , Nick Desaulniers , llvm@lists.linux.dev Subject: Re: [RFC][PATCH 6/6] objtool: Add IBT validation / fixups In-Reply-To: <202202151503.91E9B76B@keescook> References: <202202081541.900F9E1B@keescook> <202202082003.FA77867@keescook> <9ea50c51ee8db366430c9dc697a83923@overdrivepizza.com> <20220211133803.GV23216@worktop.programming.kicks-ass.net> <20220214222550.GB23216@worktop.programming.kicks-ass.net> <202202151129.1A5C5FE42@keescook> <20220215210550.GD23216@worktop.programming.kicks-ass.net> <202202151503.91E9B76B@keescook> Message-ID: <4553dfb68285a686737969e117bf48cc@overdrivepizza.com> X-Sender: joao@overdrivepizza.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit >> >> Mostly so that we can deduce the address of the trap from the >> retpoline >> site, also the above has a fairly high chance of using jcc.d32 which >> is >> actually larger than jcc.d8+ud2. > > Ah, yeah, that's an interesting point. > > Still, I worry about finding ways to convinces Clang to emit precisely > cmp/je/trap/call, but I guess we'll catch it immediately if it doesn't. > :P This can probably be done more easily/precisely if implemented directly in the compiler's arch-specific backend. At least for x86 it wasn't a hassle to emit a defined sequence of instructions in the past. The price is that it will require a pass specific to each supported architecture, but I guess this isn't that bad. Perhaps this is discussion for a different mailing list, idk... but just pointing that it is not a huge wall.