0001-verifyimage-Fix-segmentation-fault-that-occurs-durin.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From f7825edbd1c85380cfb5ef0cf2c16c910954f57c Mon Sep 17 00:00:00 2001
  2. From: Charlie Johnston <charlie.johnston@loftorbital.com>
  3. Date: Mon, 5 Aug 2024 13:07:25 -0700
  4. Subject: [PATCH] verifyimage: Fix segmentation fault that occurs during
  5. verifyimage.
  6. In commit d02322b, the behavior of ReadBinaryFile was changed such
  7. that it no longer populated iHT. This caused VerifyAuthentication
  8. to access a null iHT value resulting a segmentation fault.
  9. This fix changes VerifyAuthentication to call ReadHeaderTableDetails
  10. instead, where the old functionality of ReadBinaryFile now lives.
  11. Signed-off-by: Charlie Johnston <charlie.johnston@loftorbital.com>
  12. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  13. Upstream: https://github.com/Xilinx/bootgen/pull/36
  14. ---
  15. verifyimage-versal.cpp | 2 +-
  16. verifyimage-zynqmp.cpp | 2 +-
  17. 2 files changed, 2 insertions(+), 2 deletions(-)
  18. diff --git a/verifyimage-versal.cpp b/verifyimage-versal.cpp
  19. index 5490663..5656e50 100755
  20. --- a/verifyimage-versal.cpp
  21. +++ b/verifyimage-versal.cpp
  22. @@ -34,7 +34,7 @@
  23. /*******************************************************************************/
  24. void VersalReadImage::VerifyAuthentication(bool verifyImageOption)
  25. {
  26. - ReadBinaryFile();
  27. + ReadHeaderTableDetails();
  28. if (iHT->headerAuthCertificateWordOffset != 0)
  29. {
  30. diff --git a/verifyimage-zynqmp.cpp b/verifyimage-zynqmp.cpp
  31. index d4812e6..d73272c 100755
  32. --- a/verifyimage-zynqmp.cpp
  33. +++ b/verifyimage-zynqmp.cpp
  34. @@ -50,7 +50,7 @@ static void RearrangeEndianess(uint8_t *array, uint32_t size)
  35. /*******************************************************************************/
  36. void ZynqMpReadImage::VerifyAuthentication(bool verifyImageOption)
  37. {
  38. - ReadBinaryFile();
  39. + ReadHeaderTableDetails();
  40. if (iHT->headerAuthCertificateWordOffset != 0)
  41. {
  42. --
  43. 2.39.5