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: <m16478qyxx.fsf@ebiederm.dsl.xmission.com>
Date:	Fri, 04 May 2007 11:30:02 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>,
	Rusty Russell <rusty@...tcorp.com.au>, Andi Kleen <ak@...e.de>,
	Chris Wright <chrisw@...s-sol.org>,
	Zachary Amsden <zach@...are.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 3/3] boot bzImages under paravirt

"H. Peter Anvin" <hpa@...or.com> writes:

> Eric W. Biederman wrote:
>> 
>> We have real mystery historical cases in Gujin and ELILO.  So it
>> probably makes sense at this point to force a gdt reload if we can and
>> otherwise require all of the segments %ds, %es, %fs, %gs to be loaded
>> with a valid segment, that we can reach everything we need to touch
>> from.
>> 
>
> I think we should avoid using %fs and %gs (no use for them, anyway); but
> I think it's a decent expectation to have %cs, %ds, %es, and %ss set up.

Yes we have no need for %fs and %gs.  Lumping them in with the rest is
just extra helpfulness.

Basically be conservative in what you send (all segments).
Be liberal in what you accept (%cs,%ds,%es,%ss) and less if
we can get away with it.

> Gujin seems to have a near-zero user community, so if they have to rev
> their code it wouldn't be a big deal (the author keeps trying to push
> some crack-smoking "Gujin native" patches into the kernel, too), 
> breaking ELILO would hurt anyone using Intel Macs.

I'm thinking we just make the code start.
startup_32:
	movl	%cs, %eax
        testl   $3, %eax
        jnz     1f

	lgdt boot_gdt_descr - __PAGE_OFFSET
	movl $(__BOOT_DS),%eax
	movl %eax,%ds
	movl %eax,%es
	movl %eax,%fs
	movl %eax,%gs
        movl %eax,%ss
1:

But that won't work if we want to support relocatability.
Because we can't load a gdt if we don't know where we are.

To find out where we are we need %ss and %ds, at which point
we might as well assume we have %es to.

I think that will work in the elilo case but we can't reload them.
As silly elilo loaded a new gdt but not it's segments...

So be it then.  The next rev of the boot protocol gets to be partially
incompatible, and we just assume that %cs, %ds, %es, %ss meet our
basic requirements.  I'm pretty certain from what I saw only Gujin
is going to suffer  :(

Yep it is long past time that we document what needs to happen for
the 32bit entry point of the linux kernel.

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