Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1458983pxb; Thu, 28 Oct 2021 04:14:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH9fsLm1z0FcpjzFOUqq6k8D2UzgSYDPXmr1OQrt5VF4RHLTmARxXFuWxSBxg5T0fyYyQP X-Received: by 2002:a17:906:258d:: with SMTP id m13mr4818357ejb.208.1635419683462; Thu, 28 Oct 2021 04:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635419683; cv=none; d=google.com; s=arc-20160816; b=BBB3zDqly214S+dTtof+xFEUjbTBCNhSenat2fN9/56M7kmbnJ1mG88+2Fp2onBZtW og2qrH/LEtJ4TRS70aGM6hsRhCdZANADJUSm4fMhBVH3+9JDW/7cEb+P6rvIosjndHqP XDwk9QNr2cjfzA21SqWVQetVLuTaUqxDgDATReBWbTu2XsHBwPoviqeutRIpFcxGGnEL Cz33zjrwhOE+uLsGXZp2AEscD85+nhAB6HPbSAzDuTaDAywvhjrF+p3tl7bN6ev+FRAs OWpWNC8tk/rWRvX+wkpgImFPQbOTEbG8rSyeLhHuID31eObtDzanj5g0v4Pfgq0U9LOg ULkA== 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=N7GZ22gb+iGao7JNthfhMzqUFJ1nHCbCiKPouEv2QCE=; b=zSFagYzjnVUk9AyjEgbz/zwIgO87s3UuF4DjyW3rPu8RZx/2qt6mD2GCgXJ/gBnxDT IdO7A/ZfCNykmAGg3wxVYOevsCJrn8Sljw1LkVMmTrvRJFsNNmf4T5fJzeJOWhC34vM1 7/iLooaty8c9tN+IlqgojDgVaMdSJ0oFmX4usqVJoBy/H0tZVKIIShEowev6JX5vjHfr QYxphvC93J8xur3+tDxpCOp8e4IziSMzUSa76Qcdt0bTySPTxJlWXmzqfYcgqnKaekc6 OIBFIaOSrxY5CQ7kV4pqm1+qje1fLqFrBE6b4Me7Ib5vMMXjzxTI5/ahqxmEmHjHDy/d r+bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uNQphv4X; 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 x8si5451271edd.626.2021.10.28.04.14.19; Thu, 28 Oct 2021 04:14:43 -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=uNQphv4X; 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 S230115AbhJ1LOn (ORCPT + 99 others); Thu, 28 Oct 2021 07:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhJ1LOn (ORCPT ); Thu, 28 Oct 2021 07:14:43 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1D2C061570; Thu, 28 Oct 2021 04:12:15 -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=N7GZ22gb+iGao7JNthfhMzqUFJ1nHCbCiKPouEv2QCE=; b=uNQphv4X1bK24WiK/EUb2sc1Ne HL0dtPCjNqlc3UAfHG3D3Djn9F66Zh1WlD5+wgguWUHBmtdIRxW2TWe8cltP3lXclj/GKV7AtWIWI 7zJAsFhlpPsxGNzdZnSVjE6mUmBsl71qoFuektruFPCHZXqIXw2TAi+4AAf6CD26MgIN0YHEcEt9m R+G/Zr2/CtzLdNxT93UGDUQ1dhF0gl+XmGIYEHJDJmzGnynEUqVEMe8e/jaDMmvB7Jn0f0iWlYZKC ZR5qrUnGUc/r9lwPZdHLkv7+ODh93R9EG6a49w7nitY8fFFavnc2Abe4a6A7FR8GVaHzgis3hzQy9 dhF6OxFA==; 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 1mg3Hx-000ilK-VV; Thu, 28 Oct 2021 11:10:14 +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 92F8430022C; Thu, 28 Oct 2021 13:09:39 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5622C20D903DE; Thu, 28 Oct 2021 13:09:39 +0200 (CEST) Date: Thu, 28 Oct 2021 13:09:39 +0200 From: Peter Zijlstra To: Kees Cook Cc: Ard Biesheuvel , Mark Rutland , Sami Tolvanen , X86 ML , 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 v5 00/15] x86: Add support for Clang CFI Message-ID: References: <20211013181658.1020262-1-samitolvanen@google.com> <20211026201622.GG174703@worktop.programming.kicks-ass.net> <20211027120515.GC54628@C02TD0UTHF1T.local> <20211027124852.GK174703@worktop.programming.kicks-ass.net> <202110270939.F5C79CC@keescook> <202110271430.2A3980217@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110271430.2A3980217@keescook> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 03:27:59PM -0700, Kees Cook wrote: > Right -- though wouldn't just adding __ro_after_init do the same? > > DEFINE_STATIC_CALL(static_call_name, func_a) __ro_after_init; That breaks modules (and your jump_label patch doing the same is similarly broken). When a module is loaded that uses the static_call(), it needs to register it's .static_call_sites range with the static_call_key which requires modifying it.