Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp569211pxb; Tue, 15 Feb 2022 22:23:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4b10Vp9YnL04AeYv1UEP++P2Gz3mpbgcF5sfevacxB1QcqV/6o1n9c+RFqWFzBqy57EMY X-Received: by 2002:a17:902:7c01:b0:14f:44f2:4fa with SMTP id x1-20020a1709027c0100b0014f44f204famr1057739pll.36.1644992594636; Tue, 15 Feb 2022 22:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644992594; cv=none; d=google.com; s=arc-20160816; b=jINh6M4F387I9ljJ6MmU29QAhLXeJ9qHqbPvMmAUXmEeXepspLI7Gu2CR8JI/ZDQwY KKhLSz8ghTsi2awaBf358mvqdk2/MyreCymIC0lGOcQbxa0lzUIRLZN1GCKAZE6zh5x8 ECYVzQX1t48h7h0IqhDRxMOaaxZDfLT0d5+sf/fovRIqoS4T/aOoK08VflK5WpxOSFE4 mUn35T3GQF+3W7lnAjPEoK/9RvnsHYP/GW8Gadrz+q6TUmwvfC26DkTfbFUBFaeNrulS w7koi7vAPVHTghGvTXa9Pm+49IxLzLOl7glK+APoiLtww51TAQv55ExzAg4YKAp4Q0Mq C6tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version; bh=Y2sCkM7r+NTk7kJj7xL/I/IcKW3tySSmBf+TVqlXEUU=; b=fsJdkH0RrjFnFgczC/m7H+2GuN+9c7t3owQnTKufS1uhkj2BC7ImQmjWe6WGZz9CUx p0UovjErmJZm9OYeNiPuT06pjvAKQKjJqj+qR/neH1sAoXz/iOkEAP+CySMXVSTEv0lc St6zIJIcDAq55SnndFXly9XnISxxiRs7HWVoO9LBNhCYx3yC8VheXYqiFHX0+9/3SupF mwD/ptxHvfbUJPie/UX5jCeVbKJs3afFwVSL0bECvTOIZr417euSlG7CKQRrvcEW2C3T JJsc7i8BP8KzuDkr7y+OYgPHCmis19AAGBV1ENx9ROaPadxkwhmS8ERlOlEHXtWwB8Pp KtGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t6si7915640pld.577.2022.02.15.22.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:23:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 203071B0600; Tue, 15 Feb 2022 22:21:11 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244101AbiBOXit (ORCPT + 99 others); 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.