Re: [PATCH v5 00/15] x86: Add support for Clang CFI

Peter Zijlstra
2021-10-28T11:11:53Z

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.