Re: [PATCH v10 03/15] x86/alternatives: Disable LASS when patching kernel alternatives
From: Sohil Mehta
Date: Fri Oct 10 2025 - 13:11:11 EST
On 10/8/2025 9:22 AM, Edgecombe, Rick P wrote:
> Honestly, just unconditionally doing stac/clac doesn't sound that bad to me. We
> already unconditionally enable SMAP, right? If there was some big slowdown for a
> single copy, people would want an option to disable it. And with text patching
> it's part a heavier operation already.
>
> Was there previous feedback on that option?
>
Yes. Boris had expressed some concern about the extra toggles.
Dave and PeterZ mainly wanted to keep it separate for code isolation and
better understanding.
https://lore.kernel.org/lkml/7bbf9cae-6392-47a4-906c-7c27b1b1223d@xxxxxxxxx/
I'll leave them as separate.
>> The issues are interdependent. We need the STAC/CLAC because text poking
>> accesses special memory. We require the inline memcpy/memset because we
>> have now added the STAC/CLAC usage and objtool guards against the
>> potential misuse of STAC/CLAC.
>>
>> Were you looking for any specific change to the wording?
>
> Ah ok, but the compiler could have always uninlined the existing memcpy calls
> right? So there is an existing theoretical problem, I would think.
>
What theoretical problem?
The existing text_poke_memcpy() is a wrapper over the kernel standard
memcpy(). That is an exported function call which shouldn't be inlined
(or uninlined), right?