Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2332276pxb; Sun, 31 Oct 2021 13:13:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfAcSNKLoOtsH4pDGBy1mI0nqrdB/CKdWMxDcqs1p0o3WfBLp8TjNj8+at73pHrjbXWCGa X-Received: by 2002:a05:6602:2d8f:: with SMTP id k15mr5392038iow.31.1635711219399; Sun, 31 Oct 2021 13:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635711219; cv=none; d=google.com; s=arc-20160816; b=h6qzOw2qVPhVd/ANyP+9WXYLvjD+a9/awwVPreoz89nvv+gEUP6l+BB//uiMvuqpLK GL36q5YBsEepPRaiRCFwxWfDmcVtT3Y4gByv7Z+E7XesWlPpsVvvnzTwaGzv3ZYuTpwM vKP1UNWkOa5m5qmudmHLLyPvFeHaUfG0zVUa+Oe3PzNhbUXCNA/DQOIq699JnaRXjMM1 thZPL2Y3hGDy5AEhRebUnGxorIWofRD3Nsq78ihzSBtPs7YyXtM++ovck7uXxvdTptbJ zhpaG/WRKuWjhoTV9jFy/uDXYL+B6JDvkTZd6YO0OcDvAnHR3pvPNqETfar3KIYg11nn WZEA== 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=OW5ANKTELS4/Aqv77rAWcip0XRuLRuzAugVfabAVKQc=; b=Txzvnk06adoApMAwYvLq2BcbVm9yG3VDrkIAibZ4aYiI9GizZ7msoemlL1M4XhyVGe vZGU/Y6Kp7hIFvmsq0MEDrEvdQiInDgjMH7kfsmb5hNoQL/EKqr3eOJ2SJiRGbIsgKUV dAp2SfQlyvrszg4yfHyaS2CIFklIdpA9w98OMwEJmvDkhJ438mY0epr0/uhkq/RhW3Sx aOPiPRKxflHYSAE8wcEcrY8U0mRGG4TyLlsBAmEuspSeWCnadvX8CU01XhRpOqGwT+Zj iseHL1JGb8Bm4hnm2wmUrQkLS2CZDo9o3gXJvlp1EsFYVqxa+r05S2B3zWaRNWHsEwQG oLXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eNFWK3G4; 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 n3si16995550jat.113.2021.10.31.13.13.25; Sun, 31 Oct 2021 13:13:39 -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=casper.20170209 header.b=eNFWK3G4; 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 S229982AbhJaUOt (ORCPT + 99 others); Sun, 31 Oct 2021 16:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbhJaUOt (ORCPT ); Sun, 31 Oct 2021 16:14:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0654C061570; Sun, 31 Oct 2021 13:12:16 -0700 (PDT) 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=OW5ANKTELS4/Aqv77rAWcip0XRuLRuzAugVfabAVKQc=; b=eNFWK3G4bwmB14XaQrXIvSMW1f PdSYpdhYYUuAc84UDg5jz3ejRlnl1XNm8wfgH4eT8vgg/f736jKT8ghTEodQXsj0TLEuCTYvCgOPG +bnnwxP9zYkrUheSfcKwtKZFRhrTb2FbR77abGWs1QSa8Nnef0cnGx7d5BnlKw86ohUudlPwTrtF1 Evmcz7DRAUvFkWB3Lm0TRX+ljtIuHxLH4CB5KdLiJciuCEUwDnj7CQUCNTUocE2uOOTPcuB48RNJA zgS4tg7oJ+T62KeegFL34bkODuNiPuiqD04eSkhfGpyOvwApV6BFHR51QjsIgcL0taMyu9Smqkvh7 BN3597nA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhH9I-003HDw-Cz; Sun, 31 Oct 2021 20:10:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 712FA300243; Sun, 31 Oct 2021 21:09:46 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5250625F3BD9C; Sun, 31 Oct 2021 21:09:46 +0100 (CET) Date: Sun, 31 Oct 2021 21:09:46 +0100 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: References: <20211029200324.GR174703@worktop.programming.kicks-ass.net> <20211030074758.GT174703@worktop.programming.kicks-ass.net> <20211030180249.GU174703@worktop.programming.kicks-ass.net> <20211031163920.GV174703@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 Sun, Oct 31, 2021 at 05:44:04PM +0100, Ard Biesheuvel wrote: > > Is is also a terriblly gross hack. I really want the clang-cfi stuff to > > improve, not add layers of hacks on top of it. > > I'm just as annoyed as you are about the apparent need for this. > However, emitting an alias at build time is far better IMHO than > adding a magic byte sequence and having to check it at runtime. Oh, I'm keeping that magic sequence :-) That's hardening in general, and I don't want to ever want to debug a wrong poke like that again. Adding an extra label fixes this thing, but there's still the other cases where we need/want/desire a *real* function pointer. I'm very close to saying that anything that mucks up function pointers like this is a complete non-starter. Let's start re-start this whole CFI endeavour from the start.