pvmfw: apply_debug_policy: Backup DT before unpacking

As the DT needs to be backed-up before applying the overlay due to
fdt_apply_overlay corrupting its inputs on failure, do so before
unpacking it, reducing the amount of memory needed by the backup Vec
from the maximum size that the DT could occupy (here, 2MiB) to the
actual size that the DT has (here, a few KiB).

Note: This wasn't detected previously due to a bug in Fdt::header()
      causing fdt.as_slice() == &[] but will be required once the bug is
      fixed as pvmfw's HEAP can't hold a 2MiB slice.

Bug: 280425124
Test: atest MicrodroidHostTests
Change-Id: Ic6e651a73c4fb97e4bf97c32edc0b327b6cd1def
Merged-In: Ic6e651a73c4fb97e4bf97c32edc0b327b6cd1def
1 file changed
tree: ad9cb41542e0a2a0e6a26df68e65c7d30e230cbb
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. compos/
  5. demo/
  6. docs/
  7. encryptedstore/
  8. javalib/
  9. launcher/
  10. libs/
  11. microdroid/
  12. microdroid_manager/
  13. pvmfw/
  14. rialto/
  15. tests/
  16. virtualizationmanager/
  17. virtualizationservice/
  18. vm/
  19. vm_payload/
  20. vmbase/
  21. vmclient/
  22. zipfuse/
  23. .clang-format
  24. .gitignore
  25. Android.bp
  26. OWNERS
  27. PREUPLOAD.cfg
  28. README.md
  29. TEST_MAPPING
README.md

Virtualization

This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.