[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51E082B5.4020401@zytor.com>
Date: Fri, 12 Jul 2013 15:27:01 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Kees Cook <keescook@...omium.org>
CC: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
Borislav Petkov <bp@...e.de>,
Fenghua Yu <fenghua.yu@...el.com>,
Yinghai Lu <yinghai@...nel.org>,
Seiji Aguchi <seiji.aguchi@....com>,
PaX Team <pageexec@...email.hu>
Subject: Re: [PATCH] x86: make sure IDT is page aligned
On 07/12/2013 11:30 AM, Kees Cook wrote:
> Since the IDT is referenced from a fixmap, make sure it is page aligned.
> This avoids the risk of it ever being moved in the bss and having the
> fixmap fail.
>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> Reported-by: PaX Team <pageexec@...email.hu>
> Cc: stable@...r.kernel.org
> ---
> arch/x86/kernel/head_32.S | 2 +-
> arch/x86/kernel/head_64.S | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
> index e65ddc6..3526dd1 100644
> --- a/arch/x86/kernel/head_32.S
> +++ b/arch/x86/kernel/head_32.S
> @@ -734,7 +734,7 @@ boot_gdt_descr:
> .word __BOOT_DS+7
> .long boot_gdt - __PAGE_OFFSET
>
> - .word 0 # 32-bit align idt_desc.address
> + .word PAGE_SIZE # page align idt_desc.address
> idt_descr:
> .word IDT_ENTRIES*8-1 # idt contains 256 entries
> .long idt_table
> diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
> index 5e4d8a8..77e6d3e 100644
> --- a/arch/x86/kernel/head_64.S
> +++ b/arch/x86/kernel/head_64.S
> @@ -513,7 +513,7 @@ ENTRY(phys_base)
> #include "../../x86/xen/xen-head.S"
>
> .section .bss, "aw", @nobits
> - .align L1_CACHE_BYTES
> + .align PAGE_SIZE
> ENTRY(idt_table)
> .skip IDT_ENTRIES * 16
>
>
You are aligning the IDT *descriptor*, not the IDT itself?
-hpa
--
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