From: Ard Biesheuvel Subject: Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers Date: Fri, 5 Oct 2018 16:03:53 +0200 Message-ID: References: <20181005081333.15018-1-ard.biesheuvel@linaro.org> <20181005081333.15018-2-ard.biesheuvel@linaro.org> <20181005135728.GR19272@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Mailing List , "Jason A . Donenfeld" , Eric Biggers , Samuel Neves , Andy Lutomirski , Arnd Bergmann , Herbert Xu , "David S. Miller" , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Kees Cook , "Martin K. Petersen" , Greg Kroah-Hartman , Andrew Morton Return-path: In-Reply-To: <20181005135728.GR19272@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On 5 October 2018 at 15:57, Peter Zijlstra wrote: > On Fri, Oct 05, 2018 at 10:13:25AM +0200, Ard Biesheuvel wrote: >> Add a function pointer abstraction that can be implemented by the arch >> in a manner that avoids the downsides of function pointers, i.e., the >> fact that they are typically located in a writable data section, and >> their vulnerability to Spectre like defects. >> >> The FFP (or fast function pointer) is callable as a function, since >> the generic incarnation is simply that. However, due to the fact that >> C does not distinguish between functions and function pointers at the >> call site, the architecture can instead emit it as a patchable sequence >> of instructions consisting of ordinary branches. > > This is basically a static_key, except for indirection function calls? Yes, that is why I put you on cc :-) > So why not call the thing static_func or static_call or something like > that? Yep that sounds better.