[coreboot] [PATCH] Re: LZMA magic number
Myles Watson
mylesgw at gmail.com
Wed Aug 27 23:22:38 CEST 2008
> -----Original Message-----
> From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org]
> On Behalf Of Ward Vandewege
> Sent: Wednesday, August 27, 2008 3:02 PM
> To: Carl-Daniel Hailfinger
> Cc: coreboot at coreboot.org
> Subject: [coreboot] [PATCH] Re: LZMA magic number
>
> On Sat, Jan 26, 2008 at 02:18:39AM +0100, Carl-Daniel Hailfinger wrote:
> > On 25.01.2008 18:58, Peter Stuge wrote:
> > > On Fri, Jan 25, 2008 at 10:55:24AM -0700, Myles Watson wrote:
> > >
> > >> I accidentally used an uncompressed payload with v2 when it
> > >> expected a compressed payload, and it gave me the message:
> > >>
> > >> Decoder scratchpad too small!!
> > >> Decoding error = 1
> > >>
> > >
> > > I got this too.
> > >
> > >> I think it would be nicer to have an error like:
> > >>
> > >> Payload not compressed with lzma!
> > >
> > > And we can check it already at build time.
> >
> > LZMA compressed payloads to not have a magic number, all you can do is
> > check if the header parameters are in a reasonable range. Sorry.
> > This problem fortunately does not exist in v3 because LAR does the
> > compression itself and notes the compression type in th header.
>
> I ran into this runtime error as well today.
>
> Please find a patch attached that makes coreboot a bit smarter in dealing
> with this situation, and avoids the fatal runtime error.
Ward,
I like the idea of assuming no compression if uncompressing it fails. I
wonder if it would be better to copy it to dest instead of running it in
place.
Thanks,
Myles
More information about the coreboot
mailing list