Re: [tip:x86/urgent] x86: Make sure IDT is page aligned

From: Kees Cook
Date: Mon Jul 15 2013 - 14:37:29 EST


Hi,

On Mon, Jul 15, 2013 at 11:09 AM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
> On 07/13/2013 02:34 PM, Yinghai Lu wrote:
>>
>> can we use put all idt_table related in to __bss.aligned section ...?
>>
>> like
>> gate_desc idt_table[NR_VECTORS] __page_aligned_bss;
>>
>
> I think this is the best solution all around... it not only solves the
> initializer problem but also reduces the size of data.
>
> A long, long time ago in a galaxy far, far away I believe the IDT got
> set up before we cleared bss, but that is no longer the case as we now
> clear bss very, very early (on 32 bits before paging is even enabled.)
>
> Still, it would seem that the minimal solution, if we need something for
> 3.11/stable, is to simply fix the alignment statement in head_64.S
> (optionally move to .bss..page_aligned) and then do the proper cleanup
> for 3.12. If you could prepare a patch for the former (please include
> the descriptions we discussed over IRC) and a patchset for the latter it
> would be good.

Sorry for the trouble I caused on this. I've reorganized how I do test
builds now, which should hopefully cut down on my stupid mistakes.

I'll send two patches, one for 3.11/stable with the absolute minimal
change to alignment, and another for 3.12 that moves all the IDT
variables into common places using __page_aligned_bss as Yinghai Lu
recommended.

Thanks,

-Kees


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