leak chainload options and bump kernel

This commit is contained in:
2025-10-12 17:45:16 -07:00
parent e203271e1d
commit f782341a0d
2 changed files with 10 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
ARG KERNEL_SOURCE_URL=https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.16.9.tar.xz
ARG KERNEL_CHECKSUM=sha256:7ac8c8a3cf05476375deaaa85dfcee095a826ffe557b437f43774fc3b64ce58d
ARG KERNEL_SOURCE_URL=https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.17.2.tar.xz
ARG KERNEL_CHECKSUM=sha256:fdebcb065065f5c1b8dc68a6fb59cda50cdddbf9103d207c2196d55ea764f57f
FROM --platform=$BUILDPLATFORM debian:trixie@sha256:fd8f5a1df07b5195613e4b9a0b6a947d3772a151b81975db27d47f093f60c6e6 AS buildenv
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y \

View File

@@ -25,7 +25,7 @@ pub fn chainload(context: Rc<SproutContext>, configuration: &ChainloadConfigurat
full_path.push_str(&context.stamp(&configuration.path));
info!("path={}", full_path);
info!("path: {}", full_path);
let device_path = utils::text_to_device_path(&full_path)?;
@@ -52,7 +52,12 @@ pub fn chainload(context: Rc<SproutContext>, configuration: &ChainloadConfigurat
CString16::try_from(&options[..])
.context("unable to convert chainloader options to CString16")?,
);
info!("options={}", options);
info!("options: {}", options);
// TODO(azenla): Free this memory, if possible.
// The lifetime of the pointer needs ot outlive start_image.
// Maybe consider moving this up.
let options = Box::leak(options);
if options.num_bytes() > u32::MAX as usize {
bail!("chainloader options too large");
@@ -68,7 +73,7 @@ pub fn chainload(context: Rc<SproutContext>, configuration: &ChainloadConfigurat
}
let (base, size) = loaded_image_protocol.info();
info!("loaded image base={:#x} size={:#x}", base.addr(), size);
info!("loaded image: base={:#x} size={:#x}", base.addr(), size);
uefi::boot::start_image(image).context("failed to start image")?;
Ok(())
}