Re: [regression?] 2.6.26 floppy boot failure with kernel packed using 'upx'

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Frans Pop <elendil@...>
Cc: <linux-kernel@...>, Thomas Gleixner <tglx@...>, Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>, H. Peter Anvin <hpa@...>
Date: Thursday, July 10, 2008 - 3:47 am

On Thu, 2008-07-10 at 06:54 +0200, Frans Pop wrote:

I can repro this.


This is the first time I've looked at UPX but from glancing through the
code it certainly appears to make a lot of assumptions about the
structure of the bzImage (to the point that it looks for specific code
sequences within the binary).

It seems that the way UPX works is that it extracts the compressed image
from the bzImage, recompresses it and rebuilds a new bzImage replacing
the decompression stage (and possibly some of the other 16 bit startup,
I'm not quite sure yet) with its own. The issue is that its new
decompressor does not understand the ELF format and expects a raw
binary.

I think that UPX probably has gone a bit beyond the documented
interfaces, but it's not unreasonable way. In fact the changeset which
you referenced (or one of the ones around it) actually adds further
documentation (in Documentation/x86/i386/boot.txt) and header fields to
aid in doing the sort of extraction UPX wants to do and documents more
explicitly the formats which can be expected to be found there. Also
around the same time a checksum field was defined which is invalidated
by the repacking.

All in all I'd say it should be treated as a new subtype/variant which
UPX should support. I'd say adding support for bzImage v2.08 to UPX
would be pretty easy for someone who knows the code base (I couldn't
even find the decompressor code, but then it's pre-coffee time here..).

Ian.
-- 
Ian Campbell

Fame lost its appeal for me when I went into a public restroom and an
autograph seeker handed me a pen and paper under the stall door.
		-- Marlo Thomas

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [regression?] 2.6.26 floppy boot failure with kernel pac..., Ian Campbell, (Thu Jul 10, 3:47 am)