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: <20090602143202.6cfcc4ce.akpm@linux-foundation.org>
Date:	Tue, 2 Jun 2009 14:32:02 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, andi@...stfloor.org,
	ying.huang@...el.com, W.Li@....COM, michaele@....ibm.com,
	mingo@...e.hu, heicars2@...ux.vnet.ibm.com,
	mschwid2@...ux.vnet.ibm.com, rusty@...tcorp.com.au,
	xiyou.wangcong@...il.com, sam@...nborg.org, jdike@...toit.com
Subject: Re: [PATCH 1/4] kernel: constructor support

On Tue, 02 Jun 2009 13:44:00 +0200
Peter Oberparleiter <oberpar@...ux.vnet.ibm.com> wrote:

> From: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
> 
> Call constructors (gcc-generated initcall-like functions) during
> kernel start and module load. Constructors are e.g. used for gcov data
> initialization.
> 
> Disable constructor support for usermode Linux to prevent conflicts
> with host glibc.
> 
> Signed-off-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
> Acked-by: Rusty Russell <rusty@...tcorp.com.au>
> Acked-by: WANG Cong <xiyou.wangcong@...il.com>
> Cc: Sam Ravnborg <sam@...nborg.org>
> Cc: Jeff Dike <jdike@...toit.com>
>
> ...
>
> --- linux-2.6.30-rc7.orig/include/asm-generic/vmlinux.lds.h	2009-06-02 10:34:37.000000000 +0200
> +++ linux-2.6.30-rc7/include/asm-generic/vmlinux.lds.h	2009-06-02 10:35:20.000000000 +0200

Sam's tree has mucked with this file in linux-next.

> @@ -332,6 +332,14 @@
>  /* Section used for early init (in .S files) */
>  #define HEAD_TEXT  *(HEAD_TEXT_SECTION)
>  
> +#ifdef CONFIG_CONSTRUCTORS
> +#define KERNEL_CTORS()	VMLINUX_SYMBOL(__ctors_start) = .; \
> +			*(.ctors)			   \
> +			VMLINUX_SYMBOL(__ctors_end) = .;
> +#else
> +#define KERNEL_CTORS()
> +#endif
> +
>  /* init and exit section handling */
>  #define INIT_DATA							\
>  	*(.init.data)							\
> @@ -340,7 +348,8 @@
>  	CPU_DISCARD(init.data)						\
>  	CPU_DISCARD(init.rodata)					\
>  	MEM_DISCARD(init.data)						\
> -	MEM_DISCARD(init.rodata)
> +	MEM_DISCARD(init.rodata)					\
> +	KERNEL_CTORS()
>  

What we now have here is

#define INIT_DATA							\
	*(.init.data)							\
	DEV_DISCARD(init.data)						\
	CPU_DISCARD(init.data)						\
	MEM_DISCARD(init.data)						\
	*(.init.rodata)							\
	DEV_DISCARD(init.rodata)					\
	CPU_DISCARD(init.rodata)					\
	MEM_DISCARD(init.rodata)

and I don't think that you wanted KERNEL_DTORS() inside the .rodata
section, so I did this:

#define INIT_DATA							\
	*(.init.data)							\
	DEV_DISCARD(init.data)						\
	CPU_DISCARD(init.data)						\
	MEM_DISCARD(init.data)						\
	KERNEL_CTORS()							\
	*(.init.rodata)							\
	DEV_DISCARD(init.rodata)					\
	CPU_DISCARD(init.rodata)					\
	MEM_DISCARD(init.rodata)

Please check that?
--
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