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:	Sun, 18 Jan 2009 13:52:49 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Brian Gerst <brgerst@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 16/17] x86-64: Remove the PDA

Hello,

Brian Gerst wrote:
> Now that the PDA is empty except for the stack canary, it can be removed.
> The irqstack is moved to the start of the per-cpu section.  If the stack
> protector is enabled, the canary overlaps the bottom 48 bytes of the irqstack
> on SMP.  On UP it is a seperate variable, since it is the only thing referenced
> via %gs.

Eh... I don't know.  Locating stack canary at hard 40byte offset is a
dirty thing to do one way or another.  I kind of like doing it
directly in the linker script as it makes the dirty nature more
obvious and doesn't require hunting down the definition in the first
section.

How about something like the following?

#define CANARY_OFFSET	40
#define CANARY_SIZE	8

DECLARE_PER_CPU(unsigned long, stack_canary);

and in linker script,

PERCPU_VADDR_PREALLOC(0, :percpu, CANARY_OFFSET + CANARY_SIZE)
per_cpu__stack_canary = __per_cpu_start + CANARY_OFFSET;

> diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
> index a09abb8..c52af06 100644
> --- a/arch/x86/kernel/vmlinux_64.lds.S
> +++ b/arch/x86/kernel/vmlinux_64.lds.S
> @@ -4,6 +4,10 @@
>  
>  #define LOAD_OFFSET __START_KERNEL_map
>  
> +#define PER_CPU_SECTIONS \
> +	*(.data.percpu.irqstack) \
> +	DEFAULT_PER_CPU_SECTIONS
> +

Where is this used?

>  #define PERCPU_VADDR(vaddr, phdr)					\
>  	PERCPU_PROLOG(vaddr)						\
> +		*(.data.percpu.first)					\
>  		*(.data.percpu.page_aligned)				\
>  		*(.data.percpu)						\
>  		*(.data.percpu.shared_aligned)				\

If this is gonna go in the generic PERCPU script directly, why just
not add DEFINE_PER_CPU_FIRST() too?

Thanks.

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