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:	Tue, 24 Jun 2014 16:31:08 +0200
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	Joe Perches <joe@...ches.com>
Cc:	Mathias Krause <minipli@...glemail.com>,
	"linux-kernel\@vger.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

Joe Perches <joe@...ches.com> writes:

> On Mon, 2014-06-23 at 08:23 +0200, Mathias Krause wrote:
>> On 23 June 2014 00:56, Joe Perches <joe@...ches.com> wrote:
>> > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote:
>> >> [...] patch 2 adds some syntactical sugar for the most popular use
>> >> case, by providing pr_<level> alike macros, namely pi_<level> for __init
>> >> code and pe_<level> for __exit code. This hides the use of the marker
>> >> macros behind the commonly known printing functions -- with just a
>> >> single character changed.
>> >>
>> >> Patch 3 exemplarily changes all strings and format strings in
>> >> arch/x86/kernel/acpi/boot.c to use the new macros. It also addresses a
>> >> few styling issues, though. But this already leads to ~1.7 kB of r/o
>> >> data moved to the .init.rodata section, marking it for release after
>> >> init.
>> >>
>> >> [...]
>> >
>> > I once proposed a similar thing.
>> >
>> > https://lkml.org/lkml/2009/7/21/421
>> >
>> > Matt Mackall replied
>> >
>> > https://lkml.org/lkml/2009/7/21/463
>> >
>> 
>> Thanks for the pointers. Have you looked at patch 2 and 3? I don't
>> think it makes the printk() case ugly. In fact, using pi_<level>()
>> should be no less readable then pr_<level>, no?
>
> I don't think it's particularly less readable, but I
> do think using the plug-in mechanism might be a better
> option as it would need no manual markings at all.

gcc already seems to contain infrastructure for this kind of thing, so
maybe it doesn't even require a plugin, but simply a little coordination
with the gcc folks. This snippet from gcc internals seems relevant:

-- Target Hook: section * TARGET_ASM_FUNCTION_RODATA_SECTION (tree
          DECL)
     Return the readonly data section associated with 'DECL_SECTION_NAME
     (DECL)'.  The default version of this function selects
     '.gnu.linkonce.r.name' if the function's section is
     '.gnu.linkonce.t.name', '.rodata.name' if function is in
     '.text.name', and the normal readonly-data section otherwise.

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