Re: [PATCH v3 03/12] x86/alternatives: Disable LASS when patching kernel alternatives

From: Edgecombe, Rick P
Date: Mon Jul 31 2023 - 18:41:28 EST


On Fri, 2023-06-09 at 21:36 +0300, Alexander Shishkin wrote:
> +/*
> + * poking_init() initializes the text poking address from the lower
> half of the
> + * address space. Relax LASS enforcement when accessing the poking
> address.
> + */
>  static void text_poke_memcpy(void *dst, const void *src, size_t len)
>  {
> -       memcpy(dst, src, len);
> +       stac();
> +       __inline_memcpy(dst, src, len);
> +       clac();
>  }
>  
>  static void text_poke_memset(void *dst, const void *src, size_t len)
>  {
>         int c = *(const int *)src;
>  
> -       memset(dst, c, len);
> +       stac();
> +       __inline_memset(dst, c, len);
> +       clac();
>  }

Why not do stac/clac in a single place inside __text_poke()?