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: <CALCETrVTqTA+Xem3dUkWo46zmk5taG0U=2BmDJLj-S80QNjP7g@mail.gmail.com>
Date:	Thu, 21 May 2015 17:38:02 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
	"H.J. Lu" <hjl.tools@...il.com>, Borislav Petkov <bp@...en8.de>,
	Jan Beulich <JBeulich@...e.com>,
	Binutils <binutils@...rceware.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: Stop relying on magic jmp behavior for early_idt_handlers

On Thu, May 21, 2015 at 5:32 PM, H. Peter Anvin <hpa@...or.com> wrote:
> On 05/21/2015 05:17 PM, Andy Lutomirski wrote:
>>
>> diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
>> index 5a9856eb12ba..4bbe0eb24d7e 100644
>> --- a/arch/x86/include/asm/segment.h
>> +++ b/arch/x86/include/asm/segment.h
>> @@ -231,12 +231,21 @@
>>  #define TLS_SIZE                     (GDT_ENTRY_TLS_ENTRIES* 8)
>>
>>  #ifdef __KERNEL__
>> -#ifndef __ASSEMBLY__
>>
>> -extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][2+2+5];
>> +/*
>> + * early_idt_handlers is an array of entry points.  For simplicity, it's
>> + * a real array.  We allocate nine bytes for each entry: two one-byte
>> + * push instructions and a five-byte jump in the worst case.
>> + */
>> +#define EARLY_IDT_HANDLER_STRIDE 9
>> +#ifndef __ASSEMBLY__
>> +extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][EARLY_IDT_HANDLER_STRIDE];
>>  #ifdef CONFIG_TRACING
>>  # define trace_early_idt_handlers early_idt_handlers
>>  #endif
>> +#endif
>> +
>> +#ifndef __ASSEMBLY__
>>
>
> Please get rid of the unnecessary #ifndef/#endif pair.

I did it to preserve logical nesting.  I didn't want the pile of
early_idt_handlers declarations and comments to have the side affect
of starting an #ifdef block.

If you still think I should change it, I'll change it.

>
>> +/* Build the early_idt_handlers array */
>>       __INIT
>>       .globl early_idt_handlers
>
> Let's use ENTRY(early_idt_handlers) for consistency.

Will do.

--Andy

>
> Otherwise it looks good.  I like the use of .fill better than moving .,
> it seems more robust to me.
>
> Conditionally-Acked-by: H. Peter Anvin <hpa@...ux.intel.com>
>



-- 
Andy Lutomirski
AMA Capital Management, LLC
--
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