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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB180C433FE for ; Tue, 15 Feb 2022 23:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244562AbiBOXit (ORCPT ); Tue, 15 Feb 2022 18:38:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231871AbiBOXir (ORCPT ); Tue, 15 Feb 2022 18:38:47 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7877C9A4FB for ; Tue, 15 Feb 2022 15:38:36 -0800 (PST) Received: (Authenticated sender: joao@overdrivepizza.com) by mail.gandi.net (Postfix) with ESMTPA id 3EEEF240004; Tue, 15 Feb 2022 23:38:33 +0000 (UTC) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> >> 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.