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: <CA+rthh8anKnxA7XuZb4BHB4a7w=Oo3LhUuD2UOwGfv2SGxLs0w@mail.gmail.com>
Date:	Wed, 25 Jun 2014 07:55:47 +0200
From:	Mathias Krause <minipli@...glemail.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Rasmus Villemoes <linux@...musvillemoes.dk>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

On 24 June 2014 23:45, Joe Perches <joe@...ches.com> wrote:
> On Tue, 2014-06-24 at 23:06 +0200, Mathias Krause wrote:
>> On 24 June 2014 22:57, Joe Perches <joe@...ches.com> wrote:
>> > On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote:
>> >> And all of those strings should be in the .rodata section, now. But
>> >> why you're asking?
>> > Because now they will be duplicated in .rodata
>> > and the __init section no?
>> No. A string marked with __init_str() will only life in the
>> .init.rodata section. No duplication.
>
> Unless the same string is used in another bit
> of code.  Then there's duplication.

Rather, unless the same string gets used in an __init and a non-__init
section of the same compilation unit. Otherwise it would be only in
one section. But having the same string used in two sections of the
same compilation unit should be a rather rare case. Merging strings
across multiple compilation units does not happen, anyway -- not now,
not with the new macros.

>
>> Having duplicated strings in .rodata and .init.rodata is also no
>> problem as the latter will be freed.
>
> They increase image size.

But as this is a rare case, it shouldn't matter, really. The
compression should compensate that, compressing multiple occurrences
of the same string efficiently.

In the more likely case, strings used only in __init code, we would
have no image size increase but an increase of free memory after
initialization.


Thanks,
Mathias
--
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