From ed8a71bba16271417eef077d92af2e89e66944df Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 9 May 2004 21:07:28 +0000 Subject: [PATCH] recognize another variation of head.S: ljmp $0x10,... committer: jreiser 1084136848 +0000 --- src/p_vmlinz.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_vmlinz.cpp b/src/p_vmlinz.cpp index be42019c..2a2a037f 100644 --- a/src/p_vmlinz.cpp +++ b/src/p_vmlinz.cpp @@ -199,8 +199,10 @@ int PackVmlinuzI386::decompressKernel() throwCantPack("trailing bytes after kernel image; use option `-f' to force packing"); } // see /usr/src/linux/arch/i386/kernel/head.S: - if (memcmp(ibuf, "\xFC\xB8", 2) != 0 - && memcmp(ibuf, "\xFC\x0F\x01", 3) != 0 ) + if (memcmp(ibuf, "\xFC\xB8", 2) != 0 /* 2.4.x: cld; mov $...,%eax */ + && memcmp(ibuf, "\xFC\x0F\x01", 3) != 0 /* 2.6.x: cld; lgdt ... */ + && !(0xEA==ibuf[0] /* 2.6.x+grsecurity+strongswan+openwall+trustix: ljmp $0x10,... */ + && 0==memcmp(5+ibuf, "\x10\x00", 2)) ) throwCantPack("unrecognized kernel architecture; use option `-f' to force packing"); // FIXME: more checks for special magic bytes in ibuf ???