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] [day] [month] [year] [list]
Date:	Sat, 2 Feb 2008 19:48:25 +0100
From:	Sam Ravnborg <sam@...nborg.org>
To:	Peter Teoh <htmldeveloper@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Incompatibility of "const" and __xxxinitdata?

On Sat, Feb 02, 2008 at 11:20:44PM +0800, Peter Teoh wrote:
> In include/linux/init.h, it is documented that all __xxxinitdata
> declaration must not have constant, as show below:
> 
>  *
>  * static int init_variable __initdata = 0;
>  * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
>  *
>  * Don't forget to initialize data not at file scope, i.e. within a function,
>  * as gcc otherwise puts the data into the bss section and not into the init
>  * section.
>  *
>  * Also note, that this data cannot be "const".
>  */
> 
> In this same init.h is also documented the preferred way of
> typecasting the variable with __initdata.
> 
> But searching through the source codes, I have found many instances of:
> 
> 1.   constant occuring in the __xxxinitdata pattern, and
> 2.   non-conformance of the variable declaration according to the
> codingstyle recommended.

Only very recently we had a tag to annotate const data in addition
to the __initdata tag.
The reason for two tags are that gcc does not allow to mix const
and non-const data in the same section.

So in the cases you list below there are most certainly no other
__initdata annotations or at least not to non-const data.

If you go forward and fix up this stuff do so in adequate steps.
So you for example do not mix net drivers with usb drivers
in the same patch.

And if fix it up then use the recommended style for the
annotation.
Improved documentation in init.h is also welcome!

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