lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a640e6f0-075d-4af7-a26f-293c1a9d4ceb@linuxfoundation.org>
Date: Tue, 15 Apr 2025 18:54:23 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Borislav Petkov <bp@...en8.de>
Cc: thomas.lendacky@....com, David Gow <davidgow@...gle.com>,
 "x86@...nel.org" <x86@...nel.org>,
 Brendan Higgins <brendan.higgins@...ux.dev>, linux-kernel@...r.kernel.org,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: sev_es_trampoline_start undefined symbol referenced errors during
 kunit run

On 4/15/25 16:29, Shuah Khan wrote:
> On 4/15/25 16:17, Borislav Petkov wrote:
>> On Tue, Apr 15, 2025 at 01:06:49PM -0600, Shuah Khan wrote:
>>> Does your arch/x86/realmode/rm/pasyms.h has reference to sev_es_trampoline_start?
>>>
>>> The one in my tree has it.
>>>
>>> arch/x86/realmode/rm/pasyms.h:pa_sev_es_trampoline_start = sev_es_trampoline_start
>>
>>
>> # ./tools/testing/kunit/kunit.py run --arch x86_64
>> ...
>>
>> [00:15:36] Elapsed time: 58.840s total, 2.096s configuring, 53.170s building, 3.487s running
>>
>> # cat arch/x86/realmode/rm/pasyms.h
>> cat: arch/x86/realmode/rm/pasyms.h: No such file or directory
>>
>> Could explain why I don't see the issue...
>>
> 
> I see arch/x86/realmode/rm/pasyms.h on my system. It is a generated
> file from arch/x86/realmode/rm Makefile
> 
> Here is the target information.
> 
> REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
> 
> sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
> 
> quiet_cmd_pasyms = PASYMS  $@
>        cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
> 
> targets += pasyms.h
> $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
>          $(call if_changed,pasyms)
> 
> The key is how and why this file gets generated and why the reference
> 
> pa_sev_es_trampoline_start = sev_es_trampoline_start
> 
> is added unconditionally even when  CONFIG_AMD_MEM_ENCRYPT is not
> enabled. I think the logic should be fixed to take AMD_MEM_ENCRYPT
> enabled or disabled into account when this pasyms.h file is generated.
> 

Okay - I think the logic to extract symbols to include in pasyms.h
will have to take AMD_MEM_ENCRYPT enabled vs. disabled into account.

running git grep sev_es_trampoline_start in arch/x86/realmode/rm shows:

header.S:       .long   pa_sev_es_trampoline_start
trampoline_64.S:SYM_CODE_START(sev_es_trampoline_start)
trampoline_64.S:SYM_CODE_END(sev_es_trampoline_start)

All of the above are under ifdef AMD_MEM_ENCRYPT conditional.
Even if pasyms.h is generated sev_es_trampoline_start should not
be included in pasyms.h if AMD_MEM_ENCRYPT is disabled.

thanks,
-- Shuah


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ