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: <50AE902D.5090705@zytor.com>
Date:	Thu, 22 Nov 2012 12:50:53 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	linux-kernel@...r.kernel.org, Rob Landley <rob@...dley.net>,
	Matt Fleming <matt.fleming@...el.com>
Subject: Re: [PATCH v3 11/12] x86, boot: add fields to support load bzImage
 and ramdisk high

On 11/22/2012 12:18 PM, Yinghai Lu wrote:
>>
>> If we can get the sentinel hack to work that would probably be useful, but
>> we need to understand the exact pathology.
>
> for kexec bzImage --real-mode-entry, code after setup_header will be executed.
>
> so we could clear value before setup_header after copy 16bit section
> from bzImage...
>
> Index: kexec-tools/kexec/arch/i386/kexec-bzImage.c
> ===================================================================
> --- kexec-tools.orig/kexec/arch/i386/kexec-bzImage.c
> +++ kexec-tools/kexec/arch/i386/kexec-bzImage.c
> @@ -212,6 +212,16 @@ int do_bzImage_load(struct kexec_info *i
>   	setup_size = kern16_size + command_line_len + PURGATORY_CMDLINE_SIZE;
>   	real_mode = xmalloc(setup_size);
>   	memcpy(real_mode, kernel, kern16_size);
> +	/*
> +	 * clear value before header
> +	 * not not clear value after header, --real-mode-entry
> +	 * need code after header.
> +	 */
> +	memset(real_mode, 0, 0x1f1);
> +	if (!real_mode_entry) {
> +		/* clear value after setup_header  */
> +		memset((unsigned char *)real_mode + 0x290, 0, kern16_size - 0x290);
> +	}
>

You really should move the memset() into the if() clause as well... 
doesn't matter at the moment, but that is the protocol.

The limit is 0x280, not 0x290, or -- better -- you can use the byte at 
0x201 to get the size.

	-hpa


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
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