lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47AA2148.3010408@zytor.com>
Date:	Wed, 06 Feb 2008 13:06:16 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Ian Campbell <ijc@...lion.org.uk>
CC:	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCHv2 2/3] x86: add a crc32 checksum to the kernel image.

Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ijc@...lion.org.uk>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: H. Peter Anvin <hpa@...or.com>
> ---
>  Documentation/i386/boot.txt |    7 +++
>  arch/x86/boot/tools/build.c |   88 ++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 94 insertions(+), 1 deletions(-)
> 
> diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
> index b5f5ba1..b567fb5 100644
> --- a/Documentation/i386/boot.txt
> +++ b/Documentation/i386/boot.txt
> @@ -531,6 +531,13 @@ Protocol:	2.08+
>  
>    The length of the compressed payload.
>  
> +**** THE IMAGE CHECKSUM
> +
> +The CRC-32 is calculated over the entire file using an initial
> +remainder of 0xffffffff.  The checksum is appended to the file;
> +therefore the CRC of the file up to the limit specified in the syssize
> +field of the header is always 0.
> +


This doesn't specify that the image checksum is present only for boot 
protocol 2.08 or later, nor does it specify the characteristic 
polynomial (for CRC32 in particular, I realize the Autodin II polynomial 
is pretty close to universal, but it should at least state that it is used.)

>  **** THE KERNEL COMMAND LINE
>  
>  The kernel command line has become an important way for the boot
> diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
> index b424874..2ba22e8 100644
> --- a/arch/x86/boot/tools/build.c
> +++ b/arch/x86/boot/tools/build.c
> @@ -50,6 +50,75 @@ typedef unsigned long  u32;
>  u8 buf[SETUP_SECT_MAX*512];
>  int is_big_kernel;
>  
> +/*----------------------------------------------------------------------*/
> +
> +static const unsigned int crctab32[] = {

Really should be "u32" rather than "unsigned int".

> +	0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,

The "U"s are redundant.

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ