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:	Tue, 4 Aug 2009 14:18:38 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Akinobu Mita <akinobu.mita@...il.com>, mingo@...hat.com,
	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/asm] x86: Introduce GDT_ENTRY_INIT()


* H. Peter Anvin <hpa@...or.com> wrote:

> On 08/03/2009 08:11 AM, Akinobu Mita wrote:
> >>>>
> >> OK, I spotted the following error, which certainly would explain a crash on
> >> an APM machine:
> >>
> >>        /* data */
> >> -       [GDT_ENTRY_APMBIOS_BASE+2]      = { { { 0x0000ffff, 0x00409200 } }
> >> },
> >> +       [GDT_ENTRY_APMBIOS_BASE+2]      = GDT_ENTRY_INIT(0x409a, 0, 0xffff),
> > 
> > Oops, I really should have checked the binary because the compiler should
> > generate same code with this patch.
> > 
> 
> Well, it doesn't even on the best of days, because the last hunk changes
> a dynamic initializer to a strange mix between static and dynamic:
> 
> -static struct desc_struct bad_bios_desc;
> +static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092, 0, 0);
> 
>  /*
>   * At some point we want to use this stack frame pointer to unwind
> @@ -476,9 +476,6 @@ void pnpbios_calls_init(union
> pnp_bios_install_struct *header)
>         pnp_bios_callpoint.offset = header->fields.pm16offset;
>         pnp_bios_callpoint.segment = PNP_CS16;
> 
> -       bad_bios_desc.a = 0;
> -       bad_bios_desc.b = 0x00409200;
> -
>         set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
>         set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));
> 
> This is about at strange as it comes; I think we could simply do:
> 
> GDT_ENTRY_INIT(0x4092, (unsigned long)__va(0x400UL), 4095-0x400);
> 
> Although perhaps the 4095 should really be PAGE_SIZE-1...

I've removed the patch for now - please resubmit when fixed.

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