public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCHv2 0/2] MdePkg/UefiDevicePathLib: Fix buffer overflows in DevPathToTextAcpiEx
@ 2023-09-27 15:51 Albecki, Mateusz
  2023-09-27 15:51 ` [edk2-devel] [PATCHv2 1/2] MdePkg/UefiDevicePathLib: Fix AcpiEx print logic Albecki, Mateusz
  2023-09-27 15:51 ` [edk2-devel] [PATCHv2 2/2] MdePkg/Test: Add DevicePathLib host test module Albecki, Mateusz
  0 siblings, 2 replies; 6+ messages in thread
From: Albecki, Mateusz @ 2023-09-27 15:51 UTC (permalink / raw)
  To: devel; +Cc: Mateusz Albecki, Michael D Kinney, Liming Gao, Zhiguang Liu

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4555

Github PR: https://github.com/tianocore/edk2/pull/4865

Fix for buffer overlows that arise in DevPathToTextAcpiEx when device path node
producer doesn't specify all of the optional strings.

Changes in v2:
- Fix AcpiExp print logic that got broken in V1
- Don't pass NULL string to print function

Tests:
- Booted the platform and confirmed that platform doesn't hang when special pool is enabled
  (special pool detects accesses outside of allocated pool)
- Examined the output of the DevPathToTextAcpiEx, here are some example strings:
  AcpiEx(@@@0000,@@@0000,0x0,INTC10E7,,) - this device path doesn't specify UIDSTR and CIDSTR
  PciRoot(0x0)/AcpiEx(UAR0002,@@@0000,0x0,UART2,,) - this device path specifies empty UIDSTR and CIDSTR
- Unit tests added in second patch are passing

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Mateusz Albecki (2):
  MdePkg/UefiDevicePathLib: Fix AcpiEx print logic
  MdePkg/Test: Add DevicePathLib host test module

 .../UefiDevicePathLib/DevicePathToText.c      |  69 +-
 MdePkg/MdePkg.ci.yaml                         |   5 +-
 MdePkg/Test/MdePkgHostTest.dsc                |   2 +
 .../Library/DevicePathLib/TestDevicePathLib.c | 638 ++++++++++++++++++
 .../Library/DevicePathLib/TestDevicePathLib.h |  26 +
 .../DevicePathLib/TestDevicePathLibHost.inf   |  33 +
 .../TestDevicePathStringConversions.c         | 370 ++++++++++
 7 files changed, 1115 insertions(+), 28 deletions(-)
 create mode 100644 MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c
 create mode 100644 MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.h
 create mode 100644 MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLibHost.inf
 create mode 100644 MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathStringConversions.c

-- 
2.39.2

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109124): https://edk2.groups.io/g/devel/message/109124
Mute This Topic: https://groups.io/mt/101619975/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-10-19 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27 15:51 [edk2-devel] [PATCHv2 0/2] MdePkg/UefiDevicePathLib: Fix buffer overflows in DevPathToTextAcpiEx Albecki, Mateusz
2023-09-27 15:51 ` [edk2-devel] [PATCHv2 1/2] MdePkg/UefiDevicePathLib: Fix AcpiEx print logic Albecki, Mateusz
2023-10-13 16:54   ` Michael D Kinney
2023-09-27 15:51 ` [edk2-devel] [PATCHv2 2/2] MdePkg/Test: Add DevicePathLib host test module Albecki, Mateusz
2023-10-13 16:54   ` Michael D Kinney
2023-10-19 16:53     ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox