From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web08.2932.1648199266814318995 for ; Fri, 25 Mar 2022 02:07:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=XOo6qDa8; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 050FD240101 for ; Fri, 25 Mar 2022 10:07:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1648199265; bh=o5pES5aMlHK7kzAcXvkGVRL2UJntmDuRa0S33ZNugPk=; h=From:Subject:Date:To:From; b=XOo6qDa8okIr1TrshJFu7aCXF+4Ew+IRNKOVz6gWLFYPniuzbVjGjXIw4GkgtdAkR HHZh/xJx1n63Ra/UgpeRalftiC8eKbzicOP3wM+vFjDCakObQsb1hITXLZ16FuiH5w kfoVEennOkTUK/6UPLr9q3kjM8D5FXaekGTkec0nvkjg82ngW67dzoDyeprbysv1WO Dh4RW79dI7DkyCKeORCN5KGK8aGv2CEg/mTo9Re6iVZhKW/BmUeCyJLhHEcdXmFNha slX2q0O0s5J9zBoir0rK2YBphrHqsuQz/mV7jqs3VhTxF9zKt3w+/qYUkFTVAyWyaN /VfWCFT3aevWQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KPx7h1LMvz9rxR; Fri, 25 Mar 2022 10:07:43 +0100 (CET) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= Mime-Version: 1.0 (1.0) Subject: Re: [edk2-devel] Question about UEFI, AddressSanitizer and MMU mappings Date: Fri, 25 Mar 2022 09:07:43 +0000 Message-Id: <765AD9BF-54CE-4161-B7D8-BF55A333975F@posteo.de> References: In-Reply-To: To: devel@edk2.groups.io, pedro.falcato@gmail.com Content-Type: multipart/alternative; boundary=Apple-Mail-C437E7CE-2A69-4D2E-895A-AF275CAEAFEC Content-Transfer-Encoding: 7bit --Apple-Mail-C437E7CE-2A69-4D2E-895A-AF275CAEAFEC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey Pedro, ASan is somewhat listed for =E2=80=9ELLVM Optimizations=E2=80=9C. A quick and dirty reference for UEFI UBSan can be found here: https://githu= b.com/acidanthera/OpenCorePkg/tree/master/Library/OcGuardLib I don=E2=80=99t think you need to strictly adhere to the UEFI spec for debu= g tooling. I cannot check the code now, but I can imagine things like Conve= rtPointer() will not be happy about non-identity-mapping OOTB. But the issu= es I can think of should be fairly easy to resolve. Best regards, Marvin > On 24. Mar 2022, at 23:32, Pedro Falcato wrote: >=20 > =EF=BB=BF > Hi! >=20 > I've been thinking about adding sanitizer support (UBSan and KASAN), like= coreboot already has, to the wiki's Tasks for the upcoming GSoC, but I'm a= bit confused by something. > Is there anything in the UEFI spec that stops us from doing non-identity = memory mappings? I know it specifies the need for the identity mappings (in= the architectures where it requires the MMU being enabled), but nowhere do= I see anything about the other parts of the address space. > Of course, UEFI supporting AddressSanitizer would be kind of dependent on= fancier memory mappings. >=20 > Thanks, > Pedro >=20 --Apple-Mail-C437E7CE-2A69-4D2E-895A-AF275CAEAFEC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hey Pedro,

ASan is somewh= at listed for =E2=80=9ELLVM Optimizations=E2=80=9C.
A= quick and dirty reference for UEFI UBSan can be found here: https://github.com/acidanthera/OpenCorePkg/tree/master/Library/OcGuardL= ib

I don=E2=80=99t thi= nk you need to strictly adhere to the UEFI spec for debug tooling. I cannot= check the code now, but I can imagine things like ConvertPointer() will no= t be happy about non-identity-mapping OOTB. But the issues I can think of s= hould be fairly easy to resolve.

Best regards,
Marvin
<= br>
On 24. Mar 2022, at 23:32, Pedro Falcato <p= edro.falcato@gmail.com> wrote:

=EF=BB=BF
Hi!
I've been thinking about adding sanitizer support (UBSan and K= ASAN), like coreboot already has, to the wiki's Tasks for the upcoming GSoC= , but I'm a bit confused by something.
Is there anything in the U= EFI spec that stops us from doing non-identity memory mappings? I know it s= pecifies the need for the identity mappings (in the architectures where it = requires the MMU being enabled), but nowhere do I see anything about the ot= her parts of the address space.
Of course, UEFI supporting Addres= sSanitizer would be kind of dependent on fancier memory mappings.
=

Thanks,
Pedro
=
=20
--Apple-Mail-C437E7CE-2A69-4D2E-895A-AF275CAEAFEC--