crdyboot: Update to uefi-0.27 and uefi-services-0.24
BUG=b:330334039
TEST=cros_workon --board reven start crdyboot
TEST=emerge-reven crdyboot
Cq-Depend: chromium:5383071
Change-Id: Idaaa768749c9afa5133b649f8199fb409cd325f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crdyboot/+/5385531
Reviewed-by: Nicholas Bishop <nicholasbishop@google.com>
Commit-Queue: George Burgess <gbiv@chromium.org>
Auto-Submit: Joseph Sussman <josephsussman@google.com>
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
diff --git a/Cargo.lock b/Cargo.lock
index 5e2ef1a..a67f530 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -923,9 +923,9 @@
[[package]]
name = "uefi"
-version = "0.25.0"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cb8f384905087f56c2fdf90bb7d94d24c600775b9f40424a4b80882ba399d47"
+checksum = "89ee9c34c612d45735fef4c478450cd2a1e64e59ad1e5988e5024af53914a854"
dependencies = [
"bitflags 2.3.2",
"log",
@@ -938,9 +938,9 @@
[[package]]
name = "uefi-macros"
-version = "0.12.0"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "023d94ef8e135d068b9a3bd94614ef2610b2b0419ade0a9d8f3501fa9cd08e95"
+checksum = "26a7b1c2c808c3db854a54d5215e3f7e7aaf5dcfbce095598cba6af29895695d"
dependencies = [
"proc-macro2",
"quote",
@@ -949,9 +949,9 @@
[[package]]
name = "uefi-raw"
-version = "0.4.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bbf45ee102da89ef37674dd5186cd766418338457e660e7a3a1bad64d122abf"
+checksum = "6cc02890e65b2b8e390d0e081907c0d5ac3931bc6935f452095d68199e3698c5"
dependencies = [
"bitflags 2.3.2",
"ptr_meta",
@@ -960,9 +960,9 @@
[[package]]
name = "uefi-services"
-version = "0.22.0"
+version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f23d40df0511a2de5cadd20c9fcb2f998ac82f0c0da8a9b2817c8e8a4f0fd6fb"
+checksum = "292d48d6dae6fb4a5f960bab64a72e9dcdbe3db7dd706ae0ace5de24580d2840"
dependencies = [
"cfg-if",
"log",
diff --git a/Cargo.toml b/Cargo.toml
index 23c688c..bcbbd54 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,8 +12,8 @@
log = { version = "0.4.0", default-features = false }
object = { version = "0.31.1", default-features = false, features = ["pe", "read_core", "unaligned"] }
sbat = "0.5.0"
-uefi = { version = "0.25.0", default-features = false, features = ["alloc"] }
-uefi-services = "0.22.0"
+uefi = { version = "0.27.0", default-features = false, features = ["alloc"] }
+uefi-services = "0.24.0"
[profile.release]
overflow-checks = true
diff --git a/libcrdy/src/page_alloc.rs b/libcrdy/src/page_alloc.rs
index 50253d2..f50bfac 100644
--- a/libcrdy/src/page_alloc.rs
+++ b/libcrdy/src/page_alloc.rs
@@ -105,11 +105,17 @@
info!("freeing {} pages at {addr:#x}", self.num_pages);
// Can't propagate an error from here, so just log it.
- if let Err(err) = self
- .system_table
- .boot_services()
- .free_pages(addr, self.num_pages)
- {
+ //
+ // Safety:
+ //
+ // By the time we call `drop` no other references to the
+ // allocation can exist, so it is safe to de-allocate the
+ // pages.
+ if let Err(err) = unsafe {
+ self.system_table
+ .boot_services()
+ .free_pages(addr, self.num_pages)
+ } {
error!("free_pages failed: {:?}", err.status());
}
}