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]
Date:	Fri, 06 Oct 2006 13:01:28 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	vgoyal@...ibm.com
Cc:	Andrew Morton <akpm@...l.org>,
	linux kernel mailing list <linux-kernel@...r.kernel.org>,
	Reloc Kernel List <fastboot@...ts.osdl.org>, ak@...e.de,
	horms@...ge.net.au, lace@...kratochvil.net, hpa@...or.com,
	magnus.damm@...il.com, lwang@...hat.com, dzickus@...hat.com,
	maneesh@...ibm.com
Subject: Re: [PATCH 12/12] i386 boot: Add an ELF header to bzImage

Vivek Goyal <vgoyal@...ibm.com> writes:

> Hi Eric,
>
> I have added cld in the regenerated patch below. 
>
> Also one more minor nit. stosb relies on being %es set properly. By the
> time control reaches loader_ok, i could not find %es being set explicitly
> hence I am assuming we are relying on bootloader to set it up for us. 

No my bad.  I was thinking it was %ds, like everything else.

> Maybe we can be little more paranoid and setup the %es before stosb. I
> have done this change too in the attached patch. Pleaese have a look.
> I know little about assembly code.

Looks good to me.

Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>

> In the lazy programmer school of fixes.
>
> I haven't really tested this in any configuration.
> But reading video.S it does use variable in the bootsector.
> It does seem to initialize the variables before use.
> But obviously something is missed.
>
> By zeroing the uninteresting parts of the bootsector just after we
> have determined we are loaded ok.  We should ensure we are
> always in a known state the entire time. 
>
> Andrew if I am right about the cause of your video not working
> when you set an enhanced video mode this should fix your boot
> problem.
>
> Singed-off-by: Eric Biederman <ebiederm@...ssion.com>
>
> Signed-off-by: Vivek Goyal <vgoyal@...ibm.com>
> ---
>
>  arch/i386/boot/setup.S |   11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff -puN arch/i386/boot/setup.S~i386-set-bootset-to-zero-fix
> arch/i386/boot/setup.S
> --- linux-2.6.18-git17/arch/i386/boot/setup.S~i386-set-bootset-to-zero-fix
> 2006-10-06 12:42:19.000000000 -0400
> +++ linux-2.6.18-git17-root/arch/i386/boot/setup.S 2006-10-06 12:49:37.000000000
> -0400
> @@ -287,6 +287,17 @@ good_sig:
>  loader_panic_mess: .string "Wrong loader, giving up..."
>  
>  loader_ok:
> +# Zero initialize the variables we keep in the bootsector
> +	movw	%cs, %ax			# aka SETUPSEG
> +	subw	$DELTA_INITSEG, %ax		# aka INITSEG
> +	movw	%ax, %es
> +	xorw	%di, %di
> +	xorb	%al, %al
> +	movw	$497, %cx
> +	cld
> +	rep
> +	stosb
> +
>  # Get memory size (extended mem, kB)
>  
>  	xorl	%eax, %eax
> _
-
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