From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EE9E2C81 for ; Wed, 27 Oct 2021 12:51:44 +0000 (UTC) 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=Cgkvcdwq0dJTP6ir5a7HxudmZPEOWaKKsMrUIHRFI/o=; b=og3HchErpvnTFHKZlelb9+dlvq 8ru+KFjDxKagLEYcb5toOiS1A84QArMCc7LwLJOekz0CPZm1sIlbDt5AiMedG9k8OjqwxnikmOW0a vpDBzYunxz51QUU+4Jzzh3St53MewLvV6rsqC2o4D8B7w0bjHWKeJa3nafRLrdub8lhEn5Qf2rSUE ac133ljKr5WuUTzLLt0X7sQSPcUY0wewP+o6ZgIntI3Pgm72i84DOrr2LVwcWAq68ddvMutW1dvYH SJDA6flr6cV7yl3J+EBS0sHE6O89v9tNOXGgnqUqsqTpQpmvLUlz1kOVQIWnLduvDOMKDpLW8E63A s+PKQECg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfiMQ-0003D7-0b; Wed, 27 Oct 2021 12:49:28 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 566C598629C; Wed, 27 Oct 2021 14:48:52 +0200 (CEST) Date: Wed, 27 Oct 2021 14:48:52 +0200 From: Peter Zijlstra To: Ard Biesheuvel Cc: Mark Rutland , Sami Tolvanen , 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 v5 00/15] x86: Add support for Clang CFI Message-ID: <20211027124852.GK174703@worktop.programming.kicks-ass.net> References: <20211013181658.1020262-1-samitolvanen@google.com> <20211026201622.GG174703@worktop.programming.kicks-ass.net> <20211027120515.GC54628@C02TD0UTHF1T.local> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Oct 27, 2021 at 02:22:27PM +0200, Ard Biesheuvel wrote: > On Wed, 27 Oct 2021 at 14:05, Mark Rutland wrote: > > > Should not this jump-table thingy get converted to an actual function > > > address somewhere around arch_static_call_transform() ? This also seems > > > relevant for arm64 (which already has CLANG_CFI supported) given: > > > > > > https://lkml.kernel.org/r/20211025122102.46089-3-frederic@kernel.org > > > > Ugh, yeah, we'll need to do the function_nocfi() dance somewhere... > > > > Sadly, that only works on symbol names, so we cannot use it to strip > CFI-ness from void *func arguments passed into the static call API, > unfortunately. Right, and while mostly static_call_update() is used, whcih is a macro and could possibly be used to wrap this, we very much rely on __static_call_update() also working without that wrapper and then we're up a creek without no paddles.