Reporting Issues
Bug 3320 - MpInitLib/Pei: WakeupBuffer is still borrowed
Summary: MpInitLib/Pei: WakeupBuffer is still borrowed
Status: CONFIRMED
Alias: None
Product: EDK2
Classification: Unclassified
Component: Code (show other bugs)
Version: Current
Hardware: All All
: Lowest normal
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-12 09:50 UTC by Marvin Häuser
Modified: 2021-11-03 10:49 UTC (History)
9 users (show)

See Also:
EDK II Code First industry standard specifications: ---
Branch URL:
Release(s) the issue is observed: EDK II Master
The OS the target platform is running: ---
Package: UefiCpuPkg
Release(s) the issues must be fixed: EDK II Master
Tianocore documents:


Attachments
.json file_v1 (1.82 KB, application/json)
2021-11-03 10:49 UTC, kevinj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Häuser 2021-04-12 09:50:11 UTC
Related to: https://bugzilla.tianocore.org/show_bug.cgi?id=3319

The "borrow" technique mentioned in above's ticket seems to still exist for PEI MpInitLib[1]. PEI should follow the DXE code to properly allocate the required memory[2]. Possibly the buffer could be shared by HOB to have a "single of point failure" for the LegacyBios-conflicting allocations.

[1] https://github.com/tianocore/edk2/blob/2072c22a0d63c780b0cc6377f6d4ffb116ad6144/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c#L191

[2] https://github.com/tianocore/edk2/commit/e4ff6349bf9ee4f3f392141374901ea4994e043e
Comment 1 John Mathews 2021-05-05 14:21:39 UTC
Hi, Marvin.  Was it intentional that BZ 3319 was filed against "EDK2" product (public), while BZ 3320 was filed against the "Tianocore Security Issues" product (Infosec)?
Comment 2 Marvin Häuser 2021-05-05 14:27:11 UTC
Hey, John. Yes, I could not find any memory safety issues in the DXE version of the library. The changes would arguably be cosmetical. Of course they will benefit review-ability, reduce complexity, and allow for easier memory protection (e.g. the proposed W^X pattern from 3326). Meanwhile the borrowed buffer in PEI is clearly a risk for memory safety.

I did not check in detail yet, and might not for another couple of weeks, but 3319 might be blocked by this issue, depending on how the shared code works.
Comment 3 John Mathews 2021-09-01 13:26:30 UTC
Hi, Marvin.
We discussed, and do not see this being an attack vector by itself.  Rather than treating this as a security issue, I propose that we make this BZ public, and develop patch in the open (no CVE will be assigned).  Are you OK with this approach?
Comment 4 Marvin Häuser 2021-09-01 13:30:59 UTC
Sure, thank you!
Comment 5 John Mathews 2021-09-01 13:37:29 UTC
Moving to confirmed and making public, per discussion in 9/1 Tianocore Infosec mtg. See comment 3.
Comment 6 kevinj 2021-11-03 10:49:51 UTC
Created attachment 863 [details]
.json file_v1

I have attached the .json file for CVE classification. Please assign a release this issue is observed in, so I can update the .json file and assign a CVE-ID to this bug. Thanks!