Re: [PATCH] x86/mm/mem_encrypt: Disable all instrumentation for SME early boot code

From: Gary R Hook
Date: Mon Apr 29 2019 - 16:16:18 EST


On 4/26/19 11:24 AM, Borislav Petkov wrote:
> On Fri, Apr 26, 2019 at 03:11:17PM +0000, Gary R Hook wrote:
>> 2) Turn off instrumentation for lib/cmdline.c. The risk is that any
>> changes to its code would not enjoy the benefits of KASAN/etc testing
>> (if enabled).
>
> What happened to Thomas' suggestion to turn off instrumentation for
> those files only when CONFIG_AMD_MEM_ENCRYPT=y?
>
> Which is a variant of 2) above with ifdeffery.
>

Ah, very good. That one escaped my list.

Yes, option 4 would be a combination of using a local copy of strncmp()
and disabling instrumentation (KASAN, KCOV, whatever) for
arch/x86/lib/cmdline.c when SME is enabled.

I have any/all of these ready to repost as a version 2 offering. What
say you?

grh