[ipxe-devel] [PATCH] [cpio] Change truncated initramfs detection
Michael Brown
mbrown at fensystems.co.uk
Tue Oct 30 02:35:45 UTC 2012
On Friday 26 Oct 2012 01:12:31 Shao Miller wrote:
> Subject: [PATCH] [cpio] Change truncated initramfs detection
>
> When Syslinux prepares an initramfs "initrd", the last file blob will
> not be padded to an initramfs alignment boundary. We now determine
> that the initrd is truncated based on the unaligned length of the
> file data.
I think there's a corner case that could result in a crash: if cpio_len < len
but cpio_align(cpio_len) > len, then len would underflow and bad things would
happen.
Attached is a slightly modified patch which I think should still solve the
problem, while guaranteeing that len cannot underflow.
Could you or Brandon test and let me know if this patch also works?
Thanks,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wimboot-truncated-initramfs-v2.patch
Type: text/x-patch
Size: 1457 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20121030/dee86c94/attachment.bin>
More information about the ipxe-devel
mailing list