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: <20250414230047.GHZ_2Tnysv9zCD6-tX@fat_crate.local>
Date: Tue, 15 Apr 2025 01:00:47 +0200
From: Borislav Petkov <bp@...en8.de>
To: Shuah Khan <skhan@...uxfoundation.org>
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>
Subject: Re: sev_es_trampoline_start undefined symbol referenced errors
 during kunit run

On Mon, Apr 14, 2025 at 04:28:44PM -0600, Shuah Khan wrote:
> Hi Tom,
> 
> I have been seeing sev_es_trampoline_start undefined symbol referenced errors
> during the following kunit test runs.
> 
> ./tools/testing/kunit/kunit.py run --arch x86_64
> ./tools/testing/kunit/kunit.py run --alltests --arch x86_64
> 
> The error is here:
> 
> ERROR:root:ld:arch/x86/realmode/rm/realmode.lds:236: undefined symbol `sev_es_trampoline_start' referenced in expression
> make[6]: *** [../arch/x86/realmode/rm/Makefile:49: arch/x86/realmode/rm/realmode.elf] Error 1
> make[5]: *** [../arch/x86/realmode/Makefile:22: arch/x86/realmode/rm/realmode.bin] Error 2
> make[4]: *** [../scripts/Makefile.build:461: arch/x86/realmode] Error 2
> 
> I made time to look into this error.
> 
> sev_es_trampoline_start is referenced in arch/x86/coco/sev/core.c twice:
> 
> - To override start_ip in  wakeup_cpu_via_vmgexit()
> - In sev_es_setup_ap_jump_table() to compute startup_ip
> 
> sev_es_trampoline_start is defined if CONFIG_AMD_MEM_ENCRYPT is enabled
> and all other references to it are under ifdef CONFIG_AMD_MEM_ENCRYPT
> conditional except the two in arch/x86/coco/sev/core.c
> 
> git grep sev_es_trampoline_start
> arch/x86/coco/sev/core.c:       start_ip = real_mode_header->sev_es_trampoline_start;
> arch/x86/coco/sev/core.c:       startup_ip = (u16)(rmh->sev_es_trampoline_start -
> arch/x86/include/asm/realmode.h:        u32     sev_es_trampoline_start;
> arch/x86/realmode/rm/header.S:  .long   pa_sev_es_trampoline_start
> arch/x86/realmode/rm/trampoline_64.S:SYM_CODE_START(sev_es_trampoline_start)
> arch/x86/realmode/rm/trampoline_64.S:SYM_CODE_END(sev_es_trampoline_start)
> 
> Why are these references not under ifdef CONFIG_AMD_MEM_ENCRYPT conditional?

obj-$(CONFIG_AMD_MEM_ENCRYPT)   += sev/

in arch/x86/coco/Makefile

The real problem looks like that pasyms.h thing which gets included at the end
of realmode.lds and which contains that symbol.

How exactly can this be reproduced? Exact steps please.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ