Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1339046pxb; Sat, 30 Oct 2021 11:05:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxZUmlEjZK8ZziFna+lxAQMxKrVjGWXf1cO5tfRiKm34IT2UTsS43HttCH9IziOBFKbEnS X-Received: by 2002:a05:6402:22ac:: with SMTP id cx12mr7135448edb.183.1635617130254; Sat, 30 Oct 2021 11:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635617130; cv=none; d=google.com; s=arc-20160816; b=Ogg0VprYXmW0QSXpuWhbdL9QEbWtsQsnLLMIkfAbLgj3IDlmUJfbOSeBSNpab4shk/ 8G9+sO4BVNtdoMMwDM75MwhymbjDS+aklV0TRFA8C/TB8Z+6ZxNVH00jj1y+nOyLrEQy fvC1o7ArVlKxKB0BIv2J7odg4oApJEo9pIS6dH78Z1AJYeWKhV1/IbhvtPgv4dAjF0cy dOi6A4NPz42hi4rOARarkwwHZrg1X3aUu21AWL6dRSf7nQGWFBIVwVo3UimyIWGsuT1C 72Hmt3mBRoeKwEGQzpxZeY0D9H2J4S27BZtvywwxkr6OPxp5KTwj3/jX5eEzmJeZGonB WyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oOr5b74ov6pX5O7+DCjQEMYj0/uvSmNv3j5bSHbVk/Y=; b=CgNaU+OfBW7vCT5b8mSsnm8YnHG5deGWP6cw5OEU7QreDXEJEw44YzO6r1xAl+r15D hTG7yX4FDkEoWUutGofiTxLt5hL7V9l0yo2fM0mZimIb6sMftdVNf+BMTAJ3T0HAZLZs Nm0IQ/k5AB2FYz/3Vla2cJIdjBtimMg3osVpv14X74QOA0yO8IhQY9YIU9aua5LWx+RV G1Y/mGlm0/bosgJ6vhUJCWaHZpDY7nGC+N6EQ9b2nYqCu5G1RVGyOm73XSB26nqQazeP TsMg3+yIog72j3oGq7ZL61Dnnz/r7J71WcMifkotRumW/LeCoG1JpT8O/A9ZrGG1B1JN F4Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Q0jrwA1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si2492509edx.464.2021.10.30.11.05.06; Sat, 30 Oct 2021 11:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Q0jrwA1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbhJ3SFr (ORCPT + 99 others); Sat, 30 Oct 2021 14:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229474AbhJ3SFq (ORCPT ); Sat, 30 Oct 2021 14:05:46 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09522C061570; Sat, 30 Oct 2021 11:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=oOr5b74ov6pX5O7+DCjQEMYj0/uvSmNv3j5bSHbVk/Y=; b=Q0jrwA1BtOPvifDot7sLVzALrr 5w2Kylbc2r22f7iEsNXzEX6AT/3HxBNm0LMqEAJAOEmr7uRJrYXcORSVEDA/E1lXBf9hWjsvkUlmC 5v6AVq5S177j7kg3fnYFrMKxKCIecEtrHL7yKLXtOGo1wZ1lWzWd612sBpcH56zc1ztPNmRvg+vIS jS5A74DKguVtKjuW9C73c2SAXrw7K707NJCSMtfjFt8Bt9qPC2tONdKD6jGraG2aZnTIZpSeZARjH eHbS3R9gisuI0wuUFhDcN2AKZa7NWkBlLHR0quvnofl9phNbrCqW0sbYEhktRy5gY1PGAB1gPqyrG MDBAEd8A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgsgt-00DGXT-TK; Sat, 30 Oct 2021 18:02:52 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id DB2EB9816BA; Sat, 30 Oct 2021 20:02:49 +0200 (CEST) Date: Sat, 30 Oct 2021 20:02:49 +0200 From: Peter Zijlstra To: Ard Biesheuvel Cc: Sami Tolvanen , Mark Rutland , X86 ML , Kees Cook , 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: <20211030180249.GU174703@worktop.programming.kicks-ass.net> References: <20211027124852.GK174703@worktop.programming.kicks-ass.net> <20211029200324.GR174703@worktop.programming.kicks-ass.net> <20211030074758.GT174703@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 30, 2021 at 07:19:53PM +0200, Ard Biesheuvel wrote: > I just realized that arm64 has the exact same problem, which is not > being addressed by my v5 of the static call support patch. Yeah, it would. > As it turns out, the v11 Clang that I have been testing with is broken > wrt BTI landing pads, and omits them from the jump table entries. > Clang 12+ adds them properly, which means that both the jump table > entry and the static call trampoline may start with BTI C + direct > branch, and we also need additional checks to disambiguate. I'm not sure, why would the static_call trampoline need a BTI C ? The whole point of static_call() is to be a direct call, we should never have an indirect call to the trampoline, that would defeat the whole purpose.